Allow Collaborator to delete documents
- acmePermissionDefinitions.xml Define new/custom role SiteAcmeCollaborator = SiteCollaborator + Delete permission Note that permissionSet of st:site, the permission definitions must include original roles (SiteManager etc), as well as the new role.
- bootstrap-context.xml Bootstrap custom permission definitions
- alf-custom-role-amp.properties Add labels for new site role in Share
Alfresco uses permissionSet st:site definition as a template. For a new site created after this module is deployed, this role behaves exactly the same as the default ones:
- it gets created when a new site is created.
- it shows up in Manage Permissions
- it shows up in Set roles in Site Membership > Add User
However, an old site, for example swsdp, created before this module is deployed will not have the role. You can use a webscript to create a group, then use JavaScript to set the permission at site level.
- Add group http://localhost:8080/alfresco/s/com/acme/group/groupzone POST application/json
{
"shortName": "site_swsdp_SiteAcmeCollaborator",
"displayName": "site_swsdp_SiteAcmeCollaborator",
"parentShortName": "site_swsdp",
"zones": ["AUTH.ALF", "APP.SHARE"]
}
Note that the zones must be set as ["AUTH.ALF", "APP.SHARE"]. The zones are different from groups manually created in Share Admin Tools. They belong to APP.DEFAULT zone.
- Set permission
var swsdpSite = search.findNode("workspace://SpacesStore/..."); // nodeRef of site swsdp
swsdpSite.setPermission("SiteAcmeCollaborator", "GROUP_site_swsdp_SiteAcmeCollaborator");
Add user "abeecher" to SiteAcmeCollabortor group. Login as "abeecher" and be able to see "Move to" and "Delete document" menus in Document List and Document Details views.