mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Community profiling - repository container WebScript auth txn improvements:
- Fix to return null when a ROLE_ authority is requested from AuthorityDAO - was making needless query to DB that always returned empty and missing caches due to null return value - RepositoryContainer improvements - reduce number of txns required during init from 2 to 1, optimized code path when runAs() user is the same as currently authenticated user - Optimized code paths through hot Dictionary/Namespace methods when MT is disabled - Javadoc corrections - small measurable difference to large scale Share test - notable improvement to “short” webscript tests – round trip time for a single low impact WebScript request improved git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@41585 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1026,7 +1026,7 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
|
||||
}
|
||||
}
|
||||
|
||||
private NodeRef getAuthorityOrNull(String name)
|
||||
private NodeRef getAuthorityOrNull(final String name)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1034,13 +1034,9 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
|
||||
{
|
||||
return personService.getPerson(name, false);
|
||||
}
|
||||
else if (AuthorityType.getAuthorityType(name).equals(AuthorityType.GUEST))
|
||||
else if (AuthorityType.getAuthorityType(name).equals(AuthorityType.GUEST) || AuthorityType.getAuthorityType(name).equals(AuthorityType.ADMIN))
|
||||
{
|
||||
return personService.getPerson(name, false);
|
||||
}
|
||||
else if (AuthorityType.getAuthorityType(name).equals(AuthorityType.ADMIN))
|
||||
{
|
||||
return personService.getPerson(name, false);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -199,7 +199,7 @@ public class AuthorityServiceImpl implements AuthorityService, InitializingBean
|
||||
canonicalName = authorityName;
|
||||
}
|
||||
|
||||
// Determine whether the administrator role is mapped to this user or one of their groups
|
||||
// Determine whether the guest role is mapped to this user or one of their groups
|
||||
return getAuthoritiesForUser(canonicalName).contains(PermissionService.GUEST_AUTHORITY);
|
||||
}
|
||||
|
||||
@@ -286,11 +286,12 @@ public class AuthorityServiceImpl implements AuthorityService, InitializingBean
|
||||
tenantService.getBaseNameUser(currentUserName).equalsIgnoreCase(AuthenticationUtil.getGuestUserName()))
|
||||
{
|
||||
isGuestUser = true;
|
||||
|
||||
}
|
||||
|
||||
// Check if any of the user's groups are listed as guest groups
|
||||
if (!isAdminUser && !isGuestUser)
|
||||
{
|
||||
if (guestGroups.size() != 0)
|
||||
{
|
||||
for (String authority : guestGroups)
|
||||
{
|
||||
@@ -301,6 +302,7 @@ public class AuthorityServiceImpl implements AuthorityService, InitializingBean
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Give admin user's the ADMINISTRATOR authorities
|
||||
if (isAdminUser)
|
||||
|
Reference in New Issue
Block a user