• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. Securing Components > Step 3: Declaring Roles

Step 3: Declaring Roles

The declaration of roles is specific to Zope 3's default security policy. Another security policy might not even have the concept of roles. Therefore, the role declaration and grants to the permissions should not even be part of your package. For simplicity and to keep it all in one place, you are going to store the policy-specific security configuration in security.zcml. For the messageboard package, you really need only two roles—User and Editor—which are declared as follows:

01 <role
02     id="book.messageboard.User"
03     title="Message Board User"
04     description="Users that actually use the Message Board."/>
05
06 <role
07     id="book.messageboard.Editor"
08     title="Message Board Editor"
09     description="The Editor can edit and delete Messages."/>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint