mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
AWC-458; new collaborator role and new checkin permission check
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2380 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -191,6 +191,7 @@ Administrator=Administrator
|
||||
Guest=Guest
|
||||
Read=Guest
|
||||
Coordinator=Coordinator
|
||||
Collaborator=Collaborator
|
||||
Contributor=Contributor
|
||||
Editor=Editor
|
||||
All=All
|
||||
|
@@ -741,8 +741,34 @@ public class BrowseBean implements IContextListener
|
||||
};
|
||||
|
||||
public NodePropertyResolver resolverCheckIn = new NodePropertyResolver() {
|
||||
public Object get(Node node) {
|
||||
return node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.CHECK_IN);
|
||||
public Object get(Node node)
|
||||
{
|
||||
boolean canCheckin = false;
|
||||
|
||||
// if the working copy has a discussion the user will also need to have
|
||||
// contributor permission on the locked node
|
||||
if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY))
|
||||
{
|
||||
if (node.hasAspect(ForumModel.ASPECT_DISCUSSABLE))
|
||||
{
|
||||
// get the original locked node (via the copiedfrom aspect)
|
||||
NodeRef lockedNodeRef = (NodeRef)nodeService.getProperty(node.getNodeRef(), ContentModel.PROP_COPY_REFERENCE);
|
||||
if (lockedNodeRef != null)
|
||||
{
|
||||
Node lockedNode = new Node(lockedNodeRef);
|
||||
canCheckin = node.hasPermission(PermissionService.CHECK_IN) &&
|
||||
lockedNode.hasPermission(PermissionService.CONTRIBUTOR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// there is no discussion so just check they have checkin permission
|
||||
// for the node
|
||||
canCheckin = node.hasPermission(PermissionService.CHECK_IN);
|
||||
}
|
||||
}
|
||||
|
||||
return canCheckin;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user