Commit a725bfcb authored by Chris McDonough's avatar Chris McDonough

A better fix to add permissions to RoleManager methods.

parent e298e4e9
...@@ -92,7 +92,7 @@ need the object's ordinary permissions intact so we can manage it. ...@@ -92,7 +92,7 @@ need the object's ordinary permissions intact so we can manage it.
import ExtensionClass, Acquisition import ExtensionClass, Acquisition
from Permission import pname from Permission import pname
from Owned import UnownableOwner from Owned import UnownableOwner
from AccessControl.PermissionRole import PermissionRole from Globals import InitializeClass
class RoleManager: class RoleManager:
def manage_getPermissionMapping(self): def manage_getPermissionMapping(self):
...@@ -119,9 +119,6 @@ class RoleManager: ...@@ -119,9 +119,6 @@ class RoleManager:
a({'permission_name': ac_perms[0], 'class_permission': p}) a({'permission_name': ac_perms[0], 'class_permission': p})
return r return r
manage_getPermissionMapping__roles__=PermissionRole('Change permissions')
def manage_setPermissionMapping(self, def manage_setPermissionMapping(self,
permission_names=[], permission_names=[],
class_permissions=[], REQUEST=None): class_permissions=[], REQUEST=None):
...@@ -151,8 +148,6 @@ class RoleManager: ...@@ -151,8 +148,6 @@ class RoleManager:
REQUEST, REQUEST,
manage_tabs_message='The permission mapping has been updated') manage_tabs_message='The permission mapping has been updated')
manage_setPermissionMapping__roles__=PermissionRole('Change permissions')
def _isBeingUsedAsAMethod(self, REQUEST =None, wannaBe=0): def _isBeingUsedAsAMethod(self, REQUEST =None, wannaBe=0):
try: try:
if hasattr(self, 'aq_self'): if hasattr(self, 'aq_self'):
...@@ -172,7 +167,6 @@ class RoleManager: ...@@ -172,7 +167,6 @@ class RoleManager:
base=getattr(p, 'aq_base', None) base=getattr(p, 'aq_base', None)
return type(base) is PermissionMapper return type(base) is PermissionMapper
def getPermissionMapping(name, obj, st=type('')): def getPermissionMapping(name, obj, st=type('')):
obj=getattr(obj, 'aq_base', obj) obj=getattr(obj, 'aq_base', obj)
...@@ -225,3 +219,5 @@ class Rewrapper(ExtensionClass.Base): ...@@ -225,3 +219,5 @@ class Rewrapper(ExtensionClass.Base):
Acquisition.ImplicitAcquisitionWrapper( Acquisition.ImplicitAcquisitionWrapper(
w, parent)) w, parent))
return apply(self, args, kw) return apply(self, args, kw)
InitializeClass(RoleManager)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment