[Zope3-dev] Re: How to get Principals Roles? Owner-Role?

Steve Alexander steve@cat-box.net
Fri, 20 Jun 2003 07:21:56 +0300


> Hmmm, I thought about using the role a user have on a object for
> checking if some parts of the page (view) should be visible or not! If
> he doesn't has the role 'Moderator' or 'Owner', there's no need to show
> him a link to the edit form, for example... perhabs, that may be done
> more easy and natural in a different way?

The classic answer to this for Zope 2 is that your application should be 
based around permissions, and not around roles. I think this still holds 
for Zope 3.

So, require a permission for each of the various parts of your page, and 
then grant those permissions as appropriate to the roles you want to use.

Using permissions rather than roles throughout your application will 
make your application independent of changes to what permissions are 
granted to roles.

> PS: I'm proud to have written my first local service! :o)

Great! What does it do?

--
Steve Alexander