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
|
@Override
|
||||||
public Set<String> getReaders(NodeRef nodeRef)
|
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);
|
Pair<String, String> iprGroups = getIPRGroups(nodeRef);
|
||||||
if (iprGroups != null)
|
if (iprGroups != null)
|
||||||
{
|
{
|
||||||
result = new HashSet<String>(authorityService.getContainedAuthorities(null, iprGroups.getFirst(), true));
|
result = getAuthorities(iprGroups.getFirst());
|
||||||
result.remove(iprGroups.getSecond());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = Collections.EMPTY_SET;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -200,20 +196,29 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
|||||||
@Override
|
@Override
|
||||||
public Set<String> getWriters(NodeRef nodeRef)
|
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);
|
Pair<String, String> iprGroups = getIPRGroups(nodeRef);
|
||||||
if (iprGroups != null)
|
if (iprGroups != null)
|
||||||
{
|
{
|
||||||
result = authorityService.getContainedAuthorities(null, iprGroups.getSecond(), true);
|
result = getAuthorities(iprGroups.getSecond());
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = Collections.EMPTY_SET;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -222,6 +227,8 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
|||||||
@Override
|
@Override
|
||||||
public void set(NodeRef nodeRef, Pair<Set<String>, Set<String>> readersAndWriters)
|
public void set(NodeRef nodeRef, Pair<Set<String>, Set<String>> readersAndWriters)
|
||||||
{
|
{
|
||||||
|
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||||
|
|
||||||
set(nodeRef, readersAndWriters.getFirst(), readersAndWriters.getSecond());
|
set(nodeRef, readersAndWriters.getFirst(), readersAndWriters.getSecond());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -147,7 +147,6 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl impleme
|
|||||||
AccessStatus result = AccessStatus.UNDETERMINED;
|
AccessStatus result = AccessStatus.UNDETERMINED;
|
||||||
if (nodeService.exists(nodeRef))
|
if (nodeService.exists(nodeRef))
|
||||||
{
|
{
|
||||||
|
|
||||||
// permission pre-processors
|
// permission pre-processors
|
||||||
List<PermissionPreProcessor> preProcessors = permissionProcessorRegistry.getPermissionPreProcessors();
|
List<PermissionPreProcessor> preProcessors = permissionProcessorRegistry.getPermissionPreProcessors();
|
||||||
for (PermissionPreProcessor preProcessor : preProcessors)
|
for (PermissionPreProcessor preProcessor : preProcessors)
|
||||||
|
Reference in New Issue
Block a user