Skip to content

Commit

Permalink
Custom IWorkspace adapter to define our own group mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mattss committed May 2, 2014
1 parent d164422 commit 440f81b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/ploneintranet/workspace/adapters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from collective.workspace.workspace import Workspace


class PloneIntranetWorkspace(Workspace):
"""
A custom workspace behaviour, based on collective.workspace
Here we define our own available groups, and the roles
they are given on the workspace.
"""

# A list of groups to which team members can be assigned.
# Maps group name -> roles
available_groups = {
u'Members': ('Reader', 'TeamMember'),
u'Admins': ('Contributor', 'Editor', 'Reviewer',
'Reader', 'TeamManager',),
}
6 changes: 6 additions & 0 deletions src/ploneintranet/workspace/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
handler=".subscribers.workspace_added"
/>

<adapter
for="ploneintranet.workspace.workspacefolder.IWorkspaceFolder"
provides="collective.workspace.interfaces.IWorkspace"
factory=".adapters.PloneIntranetWorkspace"
/>

<browser:resourceDirectory
name="ploneintranet.workspace"
directory="resources" />
Expand Down

0 comments on commit 440f81b

Please sign in to comment.