mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-3074: Review comments
This commit is contained in:
@@ -177,20 +177,16 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
@Override
|
||||
public Set<String> getReaders(NodeRef nodeRef)
|
||||
{
|
||||
Set<String> result = null;
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
|
||||
Set<String> result = Collections.EMPTY_SET;
|
||||
Pair<String, String> iprGroups = getIPRGroups(nodeRef);
|
||||
if (iprGroups != null)
|
||||
{
|
||||
result = new HashSet<String>(authorityService.getContainedAuthorities(null, iprGroups.getFirst(), true));
|
||||
result.remove(iprGroups.getSecond());
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Collections.EMPTY_SET;
|
||||
result = getAuthorities(iprGroups.getFirst());
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,20 +196,29 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
@Override
|
||||
public Set<String> getWriters(NodeRef nodeRef)
|
||||
{
|
||||
Set<String> result = null;
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
|
||||
Set<String> result = Collections.EMPTY_SET;
|
||||
Pair<String, String> iprGroups = getIPRGroups(nodeRef);
|
||||
if (iprGroups != null)
|
||||
{
|
||||
result = authorityService.getContainedAuthorities(null, iprGroups.getSecond(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Collections.EMPTY_SET;
|
||||
result = getAuthorities(iprGroups.getSecond());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get authorities for a given group
|
||||
*
|
||||
* @param group group name
|
||||
* @return Set<String> immediate authorities
|
||||
*/
|
||||
private Set<String> getAuthorities(String group)
|
||||
{
|
||||
Set<String> result = new HashSet<String>();
|
||||
result.addAll(authorityService.getContainedAuthorities(null, group, true));
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,6 +227,8 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
@Override
|
||||
public void set(NodeRef nodeRef, Pair<Set<String>, Set<String>> readersAndWriters)
|
||||
{
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
|
||||
set(nodeRef, readersAndWriters.getFirst(), readersAndWriters.getSecond());
|
||||
}
|
||||
|
||||
|
@@ -147,7 +147,6 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl impleme
|
||||
AccessStatus result = AccessStatus.UNDETERMINED;
|
||||
if (nodeService.exists(nodeRef))
|
||||
{
|
||||
|
||||
// permission pre-processors
|
||||
List<PermissionPreProcessor> preProcessors = permissionProcessorRegistry.getPermissionPreProcessors();
|
||||
for (PermissionPreProcessor preProcessor : preProcessors)
|
||||
|
Reference in New Issue
Block a user