mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Updates to the permission service to find nodes by permission assignment
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6020 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -126,8 +126,13 @@ public class AuthorityServiceImpl implements AuthorityService
|
||||
|
||||
public Set<String> getAuthorities()
|
||||
{
|
||||
Set<String> authorities = new HashSet<String>();
|
||||
String currentUserName = authenticationComponent.getCurrentUserName();
|
||||
return getAuthoritiesForUser(currentUserName);
|
||||
}
|
||||
|
||||
public Set<String> getAuthoritiesForUser(String currentUserName)
|
||||
{
|
||||
Set<String> authorities = new HashSet<String>();
|
||||
if (adminUsers.contains(currentUserName))
|
||||
{
|
||||
authorities.addAll(adminSet);
|
||||
@@ -139,7 +144,7 @@ public class AuthorityServiceImpl implements AuthorityService
|
||||
authorities.addAll(getContainingAuthorities(null, currentUserName, false));
|
||||
return authorities;
|
||||
}
|
||||
|
||||
|
||||
public Set<String> getAllAuthorities(AuthorityType type)
|
||||
{
|
||||
Set<String> authorities = new HashSet<String>();
|
||||
|
@@ -233,4 +233,18 @@ public class SimpleAuthorityServiceImpl implements AuthorityService
|
||||
return false;
|
||||
}
|
||||
|
||||
public Set<String> getAuthoritiesForUser(String currentUserName)
|
||||
{
|
||||
Set<String> authorities = new HashSet<String>();
|
||||
if (adminUsers.contains(currentUserName))
|
||||
{
|
||||
authorities.addAll(adminSet);
|
||||
}
|
||||
if(AuthorityType.getAuthorityType(currentUserName) != AuthorityType.GUEST)
|
||||
{
|
||||
authorities.addAll(allSet);
|
||||
}
|
||||
return authorities;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user