[Erp5-dev] "Hiding" modules

Jean-Paul Smets jp at nexedi.com
Sat Mar 24 11:24:43 CET 2007


Le vendredi 23 mars 2007 03:54, Yoshinori Okuji a écrit :
> On Friday 16 March 2007 13:50, Jacek Medrzycki wrote:
> > I tried to play with permissions, but It seems that if a user has no
> > permission to view and access the Person Module, he is not able to
> > access Person, even if
> > he has permissions to this particular Person (not very surprising). The
> > question is: Is there a combination of permissions that hides the
> > module from the modules dropdown but allowes user to access the object
> > contained in the module?
>
> In theory, you can only disable the View permission. The problem looks
> like the generation of breadcrumbs uses Title, and Title is protected
> with View. You can do something like this in breadcrumbs:
>
>         if hasattr(obj, 'Title'):
>             title = obj.Title()

or use getTitle() which has appropriate permission.

>         else:
>             title = 'XXX'
>         result.append( { 'id'      : now[ -1 ]
>                        , 'title'   : title
>                        , 'url'     : '%s/%s/view' % (portal_url,
> '/'.join(now))
>                        }
>                     )
>
> YO

-- 
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org
Rentalinux: Desktop Linux Server
http://www.rentalinux.com



More information about the Erp5-dev mailing list