mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Build fix
- Corrected lookup of root groups - Improved root group search in the process - Spent ages trying to work out why GROUP_BUFFY wasn't being deleted! git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19210 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -279,12 +279,25 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
|
|||||||
Pattern pattern = displayNamePattern == null ? null : Pattern.compile(SearchLanguageConversion.convert(
|
Pattern pattern = displayNamePattern == null ? null : Pattern.compile(SearchLanguageConversion.convert(
|
||||||
SearchLanguageConversion.DEF_LUCENE, SearchLanguageConversion.DEF_REGEX, displayNamePattern),
|
SearchLanguageConversion.DEF_LUCENE, SearchLanguageConversion.DEF_REGEX, displayNamePattern),
|
||||||
Pattern.CASE_INSENSITIVE);
|
Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
// Use SQL to determine root authorities
|
// Use SQL to determine root authorities
|
||||||
|
Set<String> rootAuthorities = null;
|
||||||
if (parentAuthority == null && immediate)
|
if (parentAuthority == null && immediate)
|
||||||
{
|
{
|
||||||
return getRootAuthoritiesUnderContainer(zoneName == null ? getAuthorityContainer() : getZone(zoneName),
|
NodeRef container = zoneName == null ? getAuthorityContainer() : getZone(zoneName);
|
||||||
type, pattern);
|
if (container == null)
|
||||||
|
{
|
||||||
|
// The zone doesn't even exist so there are no root authorities
|
||||||
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
rootAuthorities = getRootAuthoritiesUnderContainer(container, type, pattern);
|
||||||
|
if (pattern == null)
|
||||||
|
{
|
||||||
|
return rootAuthorities;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use a Lucene search for other criteria
|
||||||
Set<String> authorities = new TreeSet<String>();
|
Set<String> authorities = new TreeSet<String>();
|
||||||
SearchParameters sp = new SearchParameters();
|
SearchParameters sp = new SearchParameters();
|
||||||
sp.addStore(this.storeRef);
|
sp.addStore(this.storeRef);
|
||||||
@@ -358,6 +371,12 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
|
|||||||
addAuthorityNameIfMatches(authorities, DefaultTypeConverter.INSTANCE.convert(String.class, nodeService
|
addAuthorityNameIfMatches(authorities, DefaultTypeConverter.INSTANCE.convert(String.class, nodeService
|
||||||
.getProperty(nodeRef, idProp)), type, pattern);
|
.getProperty(nodeRef, idProp)), type, pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we asked for root authorities, we must do an intersection with the set of root authorities
|
||||||
|
if (rootAuthorities != null)
|
||||||
|
{
|
||||||
|
authorities.retainAll(rootAuthorities);
|
||||||
|
}
|
||||||
return authorities;
|
return authorities;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
Reference in New Issue
Block a user