mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-1999: Refactored AuthorityService.findAuthorities to support search options required by Alfresco Explorer client in efficient manner
- optional parentAuthority argument - when set will only search for authorities under a given group - optional immediate flag - when false means do a recursive search. When true means only return first level. When true and parentAuthority is null means root groups. - search expression - which is tested against the short name and the display name - reworked all existing calls for new semantics - this method is for UI search only - not for existence checking! - removed some ill-informed calls git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19203 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,7 +22,6 @@ import java.util.Set;
|
|||||||
|
|
||||||
import org.alfresco.service.cmr.security.AuthorityService;
|
import org.alfresco.service.cmr.security.AuthorityService;
|
||||||
import org.alfresco.service.cmr.security.AuthorityType;
|
import org.alfresco.service.cmr.security.AuthorityType;
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
|
||||||
import org.alfresco.web.bean.spaces.InviteSpaceUsersWizard;
|
import org.alfresco.web.bean.spaces.InviteSpaceUsersWizard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,9 +34,10 @@ public class MailInviteSpaceUsersWizard extends InviteSpaceUsersWizard
|
|||||||
protected Set<String> getGroups(String search)
|
protected Set<String> getGroups(String search)
|
||||||
{
|
{
|
||||||
// groups - text search match on supplied name
|
// groups - text search match on supplied name
|
||||||
String term = PermissionService.GROUP_PREFIX + "*" + search + "*";
|
String term = "*" + search + "*";
|
||||||
Set<String> groups;
|
Set<String> groups;
|
||||||
groups = getAuthorityService().findAuthoritiesInZone(AuthorityType.GROUP, term, AuthorityService.ZONE_APP_DEFAULT);
|
groups = getAuthorityService().findAuthorities(AuthorityType.GROUP, null, false, term,
|
||||||
|
AuthorityService.ZONE_APP_DEFAULT);
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -286,9 +286,9 @@ public class SetPermissionsDialog extends UpdatePermissionsDialog
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// groups - text search match on supplied name
|
// groups - text search match on supplied name
|
||||||
String term = PermissionService.GROUP_PREFIX + "*" + contains.trim() + "*";
|
String term = "*" + contains.trim() + "*";
|
||||||
Set<String> groups;
|
Set<String> groups;
|
||||||
groups = getAuthorityService().findAuthoritiesInZone(AuthorityType.GROUP, term, AuthorityService.ZONE_APP_DEFAULT);
|
groups = getAuthorityService().findAuthorities(AuthorityType.GROUP, null, false, term, AuthorityService.ZONE_APP_DEFAULT);
|
||||||
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
||||||
|
|
||||||
String groupDisplayName;
|
String groupDisplayName;
|
||||||
|
@@ -63,7 +63,6 @@ import org.alfresco.web.ui.common.Utils;
|
|||||||
import org.alfresco.web.ui.common.component.UIGenericPicker;
|
import org.alfresco.web.ui.common.component.UIGenericPicker;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.lucene.queryParser.QueryParser;
|
|
||||||
import org.apache.lucene.search.BooleanQuery;
|
import org.apache.lucene.search.BooleanQuery;
|
||||||
import org.springframework.mail.javamail.JavaMailSender;
|
import org.springframework.mail.javamail.JavaMailSender;
|
||||||
|
|
||||||
@@ -563,9 +562,10 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
|||||||
protected Set<String> getGroups(String search)
|
protected Set<String> getGroups(String search)
|
||||||
{
|
{
|
||||||
// groups - text search match on supplied name
|
// groups - text search match on supplied name
|
||||||
String term = PermissionService.GROUP_PREFIX + "*" + search + "*";
|
String term = "*" + search + "*";
|
||||||
Set<String> groups;
|
Set<String> groups;
|
||||||
groups = getAuthorityService().findAuthoritiesInZone(AuthorityType.GROUP, term, AuthorityService.ZONE_APP_DEFAULT);
|
groups = getAuthorityService().findAuthorities(AuthorityType.GROUP, null, false, term,
|
||||||
|
AuthorityService.ZONE_APP_DEFAULT);
|
||||||
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user