mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
MNT-25150 NodePermissionAssessor.getOwner checks for owner aspect first (#3462)
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2021 Alfresco Software Limited
|
* Copyright (C) 2005 - 2025 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -115,15 +115,15 @@ public class NodePermissionAssessor
|
|||||||
Set<QName> nodeAspects = nodeService.getAspects(node.getNodeRef());
|
Set<QName> nodeAspects = nodeService.getAspects(node.getNodeRef());
|
||||||
|
|
||||||
String userName = null;
|
String userName = null;
|
||||||
if (nodeAspects.contains(ContentModel.ASPECT_AUDITABLE))
|
if (nodeAspects.contains(ContentModel.ASPECT_OWNABLE))
|
||||||
{
|
|
||||||
userName = node.getAuditableProperties().getAuditCreator();
|
|
||||||
}
|
|
||||||
else if (nodeAspects.contains(ContentModel.ASPECT_OWNABLE))
|
|
||||||
{
|
{
|
||||||
Serializable owner = nodeService.getProperty(node.getNodeRef(), ContentModel.PROP_OWNER);
|
Serializable owner = nodeService.getProperty(node.getNodeRef(), ContentModel.PROP_OWNER);
|
||||||
userName = DefaultTypeConverter.INSTANCE.convert(String.class, owner);
|
userName = DefaultTypeConverter.INSTANCE.convert(String.class, owner);
|
||||||
}
|
}
|
||||||
|
else if (nodeAspects.contains(ContentModel.ASPECT_AUDITABLE))
|
||||||
|
{
|
||||||
|
userName = node.getAuditableProperties().getAuditCreator();
|
||||||
|
}
|
||||||
|
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user