Back to index

plone3  3.1.7
Functions | Variables
ATContentTypes.permission Namespace Reference

Functions

def wireAddPermissions

Variables

string __author__ = 'Christian Heimes <tiran@cheimes.de>'
string __docformat__ = 'restructuredtext'
tuple TYPE_ROLES = ('Manager', 'Owner')
tuple TOPIC_ROLES = ('Manager',)
tuple CHANGE_TOPIC_ROLES = TOPIC_ROLES+('Owner',)
tuple CRITERION_ROLES = ('Manager',)
string AddTopics = 'Add portal topics'
string ChangeTopics = 'Change portal topics'
string ChangeEvents = 'Change portal events'
string ModifyConstrainTypes = "Modify constrain types"
string ModifyViewTemplate = "Modify view template"
string ViewHistory = "ATContentTypes: View history"
string UploadViaURL = "ATContentTypes: Upload via url"
dictionary permissions = {}

Function Documentation

Creates a list of add permissions for all types in this project

Must be called **after** all types are registered!

Definition at line 58 of file permission.py.

00058 
00059 def wireAddPermissions():
00060     """Creates a list of add permissions for all types in this project
00061     
00062     Must be called **after** all types are registered!
00063     """
00064     global permissions
00065     atct_types = listTypes(PROJECTNAME)
00066     for atct in atct_types:
00067         if IATTopic.isImplementedByInstancesOf(atct['klass']):
00068             permission = AddTopics 
00069         elif IATTopicCriterion.isImplementedByInstancesOf(atct['klass']):
00070             permission = "%s Topic: Add %s" % (PROJECTNAME, atct['portal_type'])
00071             setDefaultRoles(permission, CRITERION_ROLES)
00072         else:
00073             permission = "%s: Add %s" % (PROJECTNAME, atct['portal_type'])
00074             setDefaultRoles(permission, TYPE_ROLES)
00075         
00076         permissions[atct['portal_type']] = permission
00077     return permissions

Here is the call graph for this function:


Variable Documentation

string ATContentTypes.permission.__author__ = 'Christian Heimes <tiran@cheimes.de>'

Definition at line 21 of file permission.py.

string ATContentTypes.permission.__docformat__ = 'restructuredtext'

Definition at line 22 of file permission.py.

string ATContentTypes.permission.AddTopics = 'Add portal topics'

Definition at line 36 of file permission.py.

Definition at line 32 of file permission.py.

string ATContentTypes.permission.ChangeEvents = 'Change portal events'

Definition at line 42 of file permission.py.

string ATContentTypes.permission.ChangeTopics = 'Change portal topics'

Definition at line 39 of file permission.py.

Definition at line 33 of file permission.py.

string ATContentTypes.permission.ModifyConstrainTypes = "Modify constrain types"

Definition at line 45 of file permission.py.

string ATContentTypes.permission.ModifyViewTemplate = "Modify view template"

Definition at line 48 of file permission.py.

Definition at line 57 of file permission.py.

Definition at line 31 of file permission.py.

tuple ATContentTypes.permission.TYPE_ROLES = ('Manager', 'Owner')

Definition at line 30 of file permission.py.

string ATContentTypes.permission.UploadViaURL = "ATContentTypes: Upload via url"

Definition at line 54 of file permission.py.

string ATContentTypes.permission.ViewHistory = "ATContentTypes: View history"

Definition at line 51 of file permission.py.