[Zope-PAS] Re: struggling with Local Role plugin

Stan McFarland sfmcfar at gmail.com
Wed Apr 11 13:16:06 EDT 2007


> a quick way to check this and roles in general, is put together a python  
> script that shows the users roles and permissions in context, as a quick  
> example, here's one i use on occassion (check_roles).. and just invoke by  
> in the url after the context, by appending check_roles.
> 
> member = context.portal_membership.getAuthenticatedMember()
> print "uid", member.getId()
> print "email", member.getProperty('fullname'), member.getProperty('email')
> print "groups", member.getGroups()
> print "roles context", member.getRolesInContext( context )
> print "perm reply", context.portal_membership.checkPermission('Reply to  
> item', context)
> print "perm add", context.portal_membership.checkPermission('Add portal  
> content', context)
> print "perm modify", context.portal_membership.checkPermission('Modify  
> portal content', context)
> print "discuss", context.portal_discussion.isDiscussionAllowedFor(context)
> 
> return printed
> 
> hth,
> 
> kapil
> 



Thanks, Kapil. I'll give it a try.  I have a feeling I may be wasting my time 
anyway, as I don't see any way to have the dynamic roles be applied for catalog 
queries.  In other words, if I have object A and object B in the same folder, 
and user1 can access object A but not B based on the external condition, user1 
should see A  but not B in a folder listing, search, navigation, etc.  Is there 
amy way at all to implement this functionality?

Thanks again,

Stan





More information about the Zope-PAS mailing list