# HG changeset patch # User Thierry Florac # Date 1511686411 -3600 # Node ID e10f82e4874e071dc06371e410894d5cc8e87321 # Parent 796b6f241affe50c8b0aff7dff418f6a2a309448 Updated shared tools interfaces diff -r 796b6f241aff -r e10f82e4874e src/pyams_content/shared/common/interfaces/__init__.py --- a/src/pyams_content/shared/common/interfaces/__init__.py Sun Nov 26 09:52:59 2017 +0100 +++ b/src/pyams_content/shared/common/interfaces/__init__.py Sun Nov 26 09:53:31 2017 +0100 @@ -33,6 +33,32 @@ from pyams_content import _ +class IBaseContentManagerRoles(Interface): + """Shared tool roles interface""" + + webmasters = PrincipalsSet(title=_("Webmasters"), + description=_("Webmasters can handle all contents, including published ones"), + role_id=WEBMASTER_ROLE, + required=False) + + pilots = PrincipalsSet(title=_("Pilots"), + description=_("Pilots can handle tool configuration, manage access rules, grant users " + "roles and manage managers restrictions"), + role_id=PILOT_ROLE, + required=False) + + managers = PrincipalsSet(title=_("Managers"), + description=_("Managers can handle main operations in tool's workflow, like publish " + "or retire contents"), + role_id=MANAGER_ROLE, + required=False) + + contributors = PrincipalsSet(title=_("Contributors"), + description=_("Contributors are users which are allowed to create new contents"), + role_id=CONTRIBUTOR_ROLE, + required=False) + + class ISharedSite(IBaseContent): """Shared site interface""" @@ -66,30 +92,8 @@ shared_content_factory = Attribute("Shared data factory") -class ISharedToolRoles(Interface): - """Shared tool roles interface""" - - webmasters = PrincipalsSet(title=_("Webmasters"), - description=_("Webmasters can handle all contents, including published ones"), - role_id=WEBMASTER_ROLE, - required=False) - - pilots = PrincipalsSet(title=_("Pilots"), - description=_("Pilots can handle tool configuration, manage access rules, grant users " - "roles and manage managers restrictions"), - role_id=PILOT_ROLE, - required=False) - - managers = PrincipalsSet(title=_("Managers"), - description=_("Managers can handle main operations in tool's workflow, like publish " - "or retire contents"), - role_id=MANAGER_ROLE, - required=False) - - contributors = PrincipalsSet(title=_("Contributors"), - description=_("Contributors are users which are allowed to create new contents"), - role_id=CONTRIBUTOR_ROLE, - required=False) +class ISharedToolRoles(IBaseContentManagerRoles): + """Shared tool roles""" class IWfSharedContent(IBaseContent): @@ -216,3 +220,6 @@ def set_restrictions(self, principal, restrictions): """Set manager restrictions for given principal""" + + def drop_restrictions(self, principal): + """Drop manager restrictions for given principal"""