should add relation_possible selector only if require_permission is in the schema
--- a/web/views/actions.py Tue Feb 17 20:46:43 2009 +0100
+++ b/web/views/actions.py Tue Feb 17 20:47:22 2009 +0100
@@ -126,17 +126,19 @@
# generic secondary actions ###################################################
-class ManagePermissions(Action):
+class ManagePermissionsAction(Action):
id = 'addpermission'
- __selectors__ = (
- (match_user_groups('managers')
- | relation_possible('require_permission', 'subject', 'EPermission')),
- )
+ __selectors__ = match_user_groups('managers')
title = _('manage permissions')
category = 'moreactions'
order = 100
-
+
+ def registered(cls, vreg):
+ if 'require_permission' in vreg.schema:
+ cls.__selectors__ |= relation_possible('require_permission', 'subject', 'EPermission',
+ action='add')
+
def url(self):
return self.rset.get_entity(0, 0).absolute_url(vid='security')
@@ -269,4 +271,3 @@
def url(self):
return self.build_url(self.id)
-