mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-1417 (User with no permissions to Hold container see "Freeze/Add to Hold" action)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@72256 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -209,20 +209,26 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
|||||||
{
|
{
|
||||||
ParameterCheck.mandatory("filePlan", filePlan);
|
ParameterCheck.mandatory("filePlan", filePlan);
|
||||||
|
|
||||||
|
List<NodeRef> holds = new ArrayList<NodeRef>();
|
||||||
|
|
||||||
// get the root hold container
|
// get the root hold container
|
||||||
NodeRef holdContainer = filePlanService.getHoldContainer(filePlan);
|
NodeRef holdContainer = filePlanService.getHoldContainer(filePlan);
|
||||||
|
|
||||||
// get the children of the root hold container
|
// If you remove the "All Records Management Roles" which means users do not have read permissions on hold container
|
||||||
List<ChildAssociationRef> holdsAssocs = nodeService.getChildAssocs(holdContainer, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
// at all, the hold container will not be found for the logged in user. That's why we need to do a check here.
|
||||||
List<NodeRef> holds = new ArrayList<NodeRef>(holdsAssocs.size());
|
if (holdContainer != null)
|
||||||
for (ChildAssociationRef holdAssoc : holdsAssocs)
|
|
||||||
{
|
{
|
||||||
NodeRef hold = holdAssoc.getChildRef();
|
// get the children of the root hold container
|
||||||
boolean hasPermissionOnHold = (permissionService.hasPermission(hold, RMPermissionModel.FILING) == AccessStatus.ALLOWED);
|
List<ChildAssociationRef> holdsAssocs = nodeService.getChildAssocs(holdContainer, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||||
if (isHold(hold) && hasPermissionOnHold)
|
for (ChildAssociationRef holdAssoc : holdsAssocs)
|
||||||
{
|
{
|
||||||
// add to list of holds
|
NodeRef hold = holdAssoc.getChildRef();
|
||||||
holds.add(hold);
|
boolean hasPermissionOnHold = (permissionService.hasPermission(hold, RMPermissionModel.FILING) == AccessStatus.ALLOWED);
|
||||||
|
if (isHold(hold) && hasPermissionOnHold)
|
||||||
|
{
|
||||||
|
// add to list of holds
|
||||||
|
holds.add(hold);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user