[Zope-dev] Questions about BasicUserFolder.authorize

Chris Withers chrisw@nipltd.com
Wed, 19 Jun 2002 10:13:16 +0100


AccessControl.User.BasicUserFolder defines:

def authorize(self, user, accessed, container, name, value, roles):

what is 'roles' in this context?

I'm working on a new release of SUF. I'd like to provide a scriptable method which can
decide what roles a user has at a given location.

Ideally this would look something like:

roles_def= {
  '/folder/object': {'chris':['Manager'],
                     'fred':['Anonymous']}
           }

def getUserDetails(self,name,object):
  
    return {
           'password':'apassword',
           'roles':roles_def[object.absolute_url()][name]
           }

Would 'authorize' be the correct place to plug this in?

If not, has anyone got any suggestions?

cheers,

Chris