[Zope] Re: How can I get all roles defined

Josh Burvill jburvill at gmail.com
Thu Mar 22 22:33:41 EDT 2007


def get_roles():
  from AccessControl.Role import RoleManager

  rs=RoleManager().userdefined_roles()

  return rs

i tried this in an external method but i only get:
('Anonymous', 'Authenticated', 'Manager', 'Owner')

and not all the roles i have defined in the folder.

I also tried the methods:
get_local_roles
and
valid_roles

I'm probably not using the right method, or doing something wrong. Any
further tips?

Thanks, Josh

On 23/03/07, Tres Seaver <tseaver at palladion.com> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Josh Burvill wrote:
> > Hi everyone,
> >
> > I need to get all the roles that are defined in the security tab of a
> > particular folder.
> >
> > I know how to get all roles that a user has got, but cannot find the
> above.
> >
> > Thanks, Josh
>
> AccessControl/Role.py is your friend.  The mix-in class is a RoleManager.
>
>
> Tres.
> - --
> ===================================================================
> Tres Seaver          +1 540-429-0999          tseaver at palladion.com
> Palladion Software   "Excellence by Design"    http://palladion.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGAxgw+gerLs4ltQ4RAvaKAJ9mp8UqlIDbbRuohTXIKAaWOCN/kgCg2DjW
> AVvfKLoA21KgGkVdwONtDmg=
> =BsoS
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070323/df15da84/attachment.htm


More information about the Zope mailing list