|
Last change
on this file was
1,
checked in by myroslav, 20 years ago
|
|
Building directory structure
|
-
Property svn:eol-style set to
native
|
|
File size:
805 bytes
|
| Line | |
|---|
| 1 | from Products.CMFCore.CMFCorePermissions import setDefaultRoles |
|---|
| 2 | from Products.Archetypes.public import listTypes |
|---|
| 3 | from Products.SimpleBlog.config import PROJECTNAME |
|---|
| 4 | |
|---|
| 5 | # Add Entry |
|---|
| 6 | CROSS_POST_PERMISSION='SimpleBlog: Cross-post' |
|---|
| 7 | |
|---|
| 8 | setDefaultRoles(CROSS_POST_PERMISSION, ( 'Manager', 'Owner' ) ) |
|---|
| 9 | |
|---|
| 10 | TYPE_ROLES = ('Manager', 'Owner') |
|---|
| 11 | |
|---|
| 12 | permissions = {} |
|---|
| 13 | def wireAddPermissions(): |
|---|
| 14 | """Creates a list of add permissions for all types in this project |
|---|
| 15 | |
|---|
| 16 | Must be called **after** all types are registered! |
|---|
| 17 | """ |
|---|
| 18 | global permissions |
|---|
| 19 | blog_types = listTypes(PROJECTNAME) |
|---|
| 20 | for btype in blog_types: |
|---|
| 21 | permission = "%s: Add %s" % (PROJECTNAME, btype['portal_type']) |
|---|
| 22 | setDefaultRoles(permission, TYPE_ROLES) |
|---|
| 23 | |
|---|
| 24 | permissions[btype['portal_type']] = permission |
|---|
| 25 | return permissions |
|---|
Note: See
TracBrowser
for help on using the repository browser.