mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
fix sonar issues
This commit is contained in:
@@ -171,7 +171,7 @@ public class FreezeServiceImpl extends ServiceBaseImpl
|
|||||||
NodeRef hold = null;
|
NodeRef hold = null;
|
||||||
if (!nodeRefs.isEmpty())
|
if (!nodeRefs.isEmpty())
|
||||||
{
|
{
|
||||||
List<NodeRef> list = new ArrayList<>(nodeRefs);
|
final List<NodeRef> list = new ArrayList<>(nodeRefs);
|
||||||
hold = createHold(list.get(0), reason);
|
hold = createHold(list.get(0), reason);
|
||||||
getHoldService().addToHold(hold, list);
|
getHoldService().addToHold(hold, list);
|
||||||
}
|
}
|
||||||
@@ -307,7 +307,7 @@ public class FreezeServiceImpl extends ServiceBaseImpl
|
|||||||
{
|
{
|
||||||
for (ChildAssociationRef childAssociationRef : childAssocs)
|
for (ChildAssociationRef childAssociationRef : childAssocs)
|
||||||
{
|
{
|
||||||
NodeRef childRef = childAssociationRef.getChildRef();
|
final NodeRef childRef = childAssociationRef.getChildRef();
|
||||||
if (childAssociationRef.isPrimary() && isFrozen(childRef))
|
if (childAssociationRef.isPrimary() && isFrozen(childRef))
|
||||||
{
|
{
|
||||||
heldCount ++;
|
heldCount ++;
|
||||||
|
@@ -90,6 +90,9 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
|||||||
private static final String AUDIT_ADD_TO_HOLD = "addToHold";
|
private static final String AUDIT_ADD_TO_HOLD = "addToHold";
|
||||||
private static final String AUDIT_REMOVE_FROM_HOLD = "removeFromHold";
|
private static final String AUDIT_REMOVE_FROM_HOLD = "removeFromHold";
|
||||||
|
|
||||||
|
/** I18N */
|
||||||
|
private static final String MSG_ERR_ACCESS_DENIED = "permissions.err_access_denied";
|
||||||
|
|
||||||
/** File Plan Service */
|
/** File Plan Service */
|
||||||
private FilePlanService filePlanService;
|
private FilePlanService filePlanService;
|
||||||
|
|
||||||
@@ -296,7 +299,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
|||||||
// check whether the record is held by virtue of it's record folder
|
// check whether the record is held by virtue of it's record folder
|
||||||
if (isRecord(nodeRef))
|
if (isRecord(nodeRef))
|
||||||
{
|
{
|
||||||
List<NodeRef> recordFolders = recordFolderService.getRecordFolders(nodeRef);
|
final List<NodeRef> recordFolders = recordFolderService.getRecordFolders(nodeRef);
|
||||||
for (NodeRef recordFolder : recordFolders)
|
for (NodeRef recordFolder : recordFolders)
|
||||||
{
|
{
|
||||||
holdsIncludingNodeRef.addAll(getParentHolds(recordFolder));
|
holdsIncludingNodeRef.addAll(getParentHolds(recordFolder));
|
||||||
@@ -305,7 +308,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
|||||||
|
|
||||||
if (!includedInHold)
|
if (!includedInHold)
|
||||||
{
|
{
|
||||||
Set<NodeRef> filePlans = filePlanService.getFilePlans();
|
final Set<NodeRef> filePlans = filePlanService.getFilePlans();
|
||||||
if (!CollectionUtils.isEmpty(filePlans))
|
if (!CollectionUtils.isEmpty(filePlans))
|
||||||
{
|
{
|
||||||
List<NodeRef> holdsNotIncludingNodeRef = new ArrayList<>();
|
List<NodeRef> holdsNotIncludingNodeRef = new ArrayList<>();
|
||||||
@@ -562,7 +565,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
|||||||
|
|
||||||
if (permissionService.hasPermission(hold, RMPermissionModel.FILING) == AccessStatus.DENIED)
|
if (permissionService.hasPermission(hold, RMPermissionModel.FILING) == AccessStatus.DENIED)
|
||||||
{
|
{
|
||||||
throw new AccessDeniedException(I18NUtil.getMessage("permissions.err_access_denied"));
|
throw new AccessDeniedException(I18NUtil.getMessage(MSG_ERR_ACCESS_DENIED));
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that the node isn't already in the hold
|
// check that the node isn't already in the hold
|
||||||
@@ -609,15 +612,12 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
|||||||
throw new IntegrityException(I18NUtil.getMessage("rm.hold.add-to-hold-invalid-type", nodeName), null);
|
throw new IntegrityException(I18NUtil.getMessage("rm.hold.add-to-hold-invalid-type", nodeName), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((isRecord(nodeRef) || isRecordFolder(nodeRef)) &&
|
if (((isRecord(nodeRef) || isRecordFolder(nodeRef)) &&
|
||||||
permissionService.hasPermission(nodeRef, RMPermissionModel.FILING) == AccessStatus.DENIED)
|
permissionService.hasPermission(nodeRef, RMPermissionModel.FILING) == AccessStatus.DENIED) ||
|
||||||
|
(instanceOf(nodeRef, ContentModel.TYPE_CONTENT) &&
|
||||||
|
permissionService.hasPermission(nodeRef, PermissionService.WRITE) == AccessStatus.DENIED))
|
||||||
{
|
{
|
||||||
throw new AccessDeniedException(I18NUtil.getMessage("permissions.err_access_denied"));
|
throw new AccessDeniedException(I18NUtil.getMessage(MSG_ERR_ACCESS_DENIED));
|
||||||
}
|
|
||||||
else if (instanceOf(nodeRef, ContentModel.TYPE_CONTENT) &&
|
|
||||||
permissionService.hasPermission(nodeRef, PermissionService.WRITE) == AccessStatus.DENIED)
|
|
||||||
{
|
|
||||||
throw new AccessDeniedException(I18NUtil.getMessage("permissions.err_access_denied"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeService.hasAspect(nodeRef, ASPECT_ARCHIVED))
|
if (nodeService.hasAspect(nodeRef, ASPECT_ARCHIVED))
|
||||||
|
@@ -165,7 +165,7 @@ public class FrozenAspect extends BaseBehaviourBean
|
|||||||
if (nodeService.exists(nodeRef) && (isRecord(nodeRef) || instanceOf(nodeRef, TYPE_CONTENT)))
|
if (nodeService.exists(nodeRef) && (isRecord(nodeRef) || instanceOf(nodeRef, TYPE_CONTENT)))
|
||||||
{
|
{
|
||||||
// get the owning folder
|
// get the owning folder
|
||||||
NodeRef parentRef = nodeService.getPrimaryParent(nodeRef).getParentRef();
|
final NodeRef parentRef = nodeService.getPrimaryParent(nodeRef).getParentRef();
|
||||||
// check that the aspect has been added
|
// check that the aspect has been added
|
||||||
if (nodeService.hasAspect(parentRef, ASPECT_HELD_CHILDREN))
|
if (nodeService.hasAspect(parentRef, ASPECT_HELD_CHILDREN))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user