Class ScriptGroup
java.lang.Object
org.alfresco.repo.security.authority.script.ScriptGroup
- All Implemented Interfaces:
Serializable,Authority
The Script group is a GROUP authority exposed to the scripting API.
It provides access to the properties of the group including the children of the group which may be groups or users.
- Author:
- mrogers
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.security.authority.script.Authority
Authority.AuthorityComparator, Authority.ScriptAuthorityType -
Constructor Summary
ConstructorsConstructorDescriptionScriptGroup(String fullName, String displayName, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) New script groupScriptGroup(String fullName, AuthorityService authorityService) Deprecated.ScriptGroup(String fullName, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) New script group -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthority(String fullAuthorityName) AddAuthority as a child of this groupcreateGroup(String newShortName, String newDisplayName) Create a new group as a child of this group.voidDelete this groupGet all sub groups (all decendants)Get all the parents of this this groupgetAllParentGroups(int maxItems, int skipCount) Get all the parents of this this groupgetAllParentGroups(ScriptPagingDetails paging, String sortBy) Get all the parents of this this groupGet all users contained in this groupGet all the children of this group, regardless of typegetChildAuthorities(ScriptPagingDetails paging, String sortBy) Get all the children of this group, regardless of typegetChildGroups(int maxItems, int skipCount) Get child groups of this groupgetChildGroups(ScriptPagingDetails paging, String sortBy) Get child groups of this groupGet child users of this groupgetChildUsers(ScriptPagingDetails paging, String sortBy) Get child users of this groupGet the full internal name, also known as the Authority NameintGet the number of child groups contained within this group.Return a ScriptNode wrapping the groupReturn the NodeRef of the groupGet the immediate parents of this groupgetParentGroups(int maxItems, int skipCount) Get the immediate parents of this groupgetParentGroups(ScriptPagingDetails paging, String sortBy) Get the immediate parents of this groupGet the short nameintGet the number of users contained within this group.getZones()Gets all the zones of this groupstatic ScriptGroup[]makeScriptGroups(Collection<String> authorities, ScriptPagingDetails paging, String sortBy, boolean sortAsc, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) static ScriptGroup[]makeScriptGroups(Collection<String> authorities, ScriptPagingDetails paging, String sortBy, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Deprecated.static ScriptGroup[]makeScriptGroups(Collection<String> authorities, ScriptPagingDetails paging, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Deprecated.static ScriptGroup[]makeScriptGroups(org.alfresco.query.PagingResults<String> pagedGroups, ScriptPagingDetails paging, String sortBy, boolean sortAsc, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Returns an array of ScriptGroup objects representing the given paged results.static ScriptGroup[]makeScriptGroups(org.alfresco.query.PagingResults<String> pagedGroups, ScriptPagingDetails paging, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Deprecated.static ScriptGroup[]makeScriptGroupsInfo(org.alfresco.query.PagingResults<AuthorityInfo> pagedGroups, ScriptPagingDetails paging, String sortBy, boolean sortAsc, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Returns an array of ScriptGroup objects representing the given paged results.voidremoveAuthority(String fullAuthorityName) Remove child Authority from this groupvoidremoveGroup(String newShortName) remove sub group from this groupvoidremoveUser(String newShortName) Remove child user from this groupvoidsetAuthorityType(Authority.ScriptAuthorityType authorityType) voidsetDisplayName(String displayName) Change the display name for this group.voidsetFullName(String fullName) voidsetShortName(String shortName)
-
Constructor Details
-
ScriptGroup
public ScriptGroup(String fullName, String displayName, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) New script group- Parameters:
fullName- StringdisplayName- StringserviceRegistry- ServiceRegistryscope- Scriptable
-
ScriptGroup
public ScriptGroup(String fullName, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) New script group- Parameters:
fullName- StringserviceRegistry- ServiceRegistryscope- Scriptable
-
ScriptGroup
Deprecated.UseScriptGroup(String, ServiceRegistry, Scriptable)insteadNew script group- Parameters:
fullName- StringauthorityService- AuthorityService
-
-
Method Details
-
deleteGroup
public void deleteGroup()Delete this group -
setAuthorityType
-
getAuthorityType
- Specified by:
getAuthorityTypein interfaceAuthority
-
setShortName
-
getShortName
Get the short name- Specified by:
getShortNamein interfaceAuthority
-
setFullName
-
getFullName
Get the full internal name, also known as the Authority Name- Specified by:
getFullNamein interfaceAuthority
-
setDisplayName
Change the display name for this group. Need administrator permission to call this method to change a display name.- Parameters:
displayName- String
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAuthority
-
getAllUsers
Get all users contained in this group- Returns:
- ScriptUser[]
-
getAllGroups
Get all sub groups (all decendants)- Returns:
- the descenants of this group
-
getChildUsers
Get child users of this group -
getChildUsers
Get child users of this group- Parameters:
paging- Paging object with max number to return, and items to skipsortBy- What to sort on (authorityName, shortName or displayName)
-
getChildGroups
-
getChildGroups
Get child groups of this group- Parameters:
maxItems- Maximum number of groups to return.skipCount- number of groups to skip before returning the first result.
-
getChildGroups
Get child groups of this group- Parameters:
paging- Paging object with max number to return, and items to skipsortBy- What to sort on (authorityName, shortName or displayName)
-
getChildAuthorities
Get all the children of this group, regardless of type -
getChildAuthorities
Get all the children of this group, regardless of type- Parameters:
paging- Paging object with max number to return, and items to skipsortBy- What to sort on (authorityName, shortName or displayName)
-
getParentGroups
Get the immediate parents of this group- Returns:
- the immediate parents of this group
-
getParentGroups
Get the immediate parents of this group- Parameters:
maxItems- Maximum number of groups to return.skipCount- number of groups to skip before returning the first result.- Returns:
- the immediate parents of this group
-
getParentGroups
Get the immediate parents of this group- Parameters:
paging- Paging object with max number to return, and items to skipsortBy- What to sort on (authorityName, shortName or displayName)- Returns:
- the immediate parents of this group
-
getAllParentGroups
Get all the parents of this this group- Returns:
- all the parents of this group
-
getAllParentGroups
Get all the parents of this this group- Parameters:
maxItems- Maximum number of groups to return.skipCount- number of groups to skip before returning the first result.- Returns:
- all the parents of this group
-
getAllParentGroups
Get all the parents of this this group- Parameters:
paging- Paging object with max number to return, and items to skipsortBy- What to sort on (authorityName, shortName or displayName)- Returns:
- all the parents of this group
-
getUserCount
public int getUserCount()Get the number of users contained within this group.- Returns:
- the number of users contained within this group.
-
getGroupCount
public int getGroupCount()Get the number of child groups contained within this group.- Returns:
- the number of child groups contained within this group.
-
createGroup
Create a new group as a child of this group.- Returns:
- the new group
-
removeGroup
remove sub group from this group- Parameters:
newShortName- the shortName of the sub group to remove from this group.
-
removeUser
Remove child user from this group- Parameters:
newShortName- the shortName of the user to remove from this group.
-
addAuthority
AddAuthority as a child of this group- Parameters:
fullAuthorityName- the full name of the authority to add to this group.
-
removeAuthority
Remove child Authority from this group- Parameters:
fullAuthorityName- the full name of the authority to remove from this group.
-
getGroupNodeRef
Return the NodeRef of the group- Since:
- 4.0
-
getGroupNode
Return a ScriptNode wrapping the group- Since:
- 4.0
-
makeScriptGroups
public static ScriptGroup[] makeScriptGroups(Collection<String> authorities, ScriptPagingDetails paging, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Deprecated. -
makeScriptGroups
public static ScriptGroup[] makeScriptGroups(Collection<String> authorities, ScriptPagingDetails paging, String sortBy, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Deprecated. -
makeScriptGroups
public static ScriptGroup[] makeScriptGroups(Collection<String> authorities, ScriptPagingDetails paging, String sortBy, boolean sortAsc, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) -
makeScriptGroups
public static ScriptGroup[] makeScriptGroups(org.alfresco.query.PagingResults<String> pagedGroups, ScriptPagingDetails paging, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Deprecated.- Since:
- 4.0
-
makeScriptGroups
public static ScriptGroup[] makeScriptGroups(org.alfresco.query.PagingResults<String> pagedGroups, ScriptPagingDetails paging, String sortBy, boolean sortAsc, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Returns an array of ScriptGroup objects representing the given paged results.- Parameters:
pagedGroups- The paged resultspaging- Object representing the paging detailssortBy- field for sortingsortAsc- sort ascending or notserviceRegistry- ServiceRegistryscope- Scriptable- Returns:
- Array of ScriptGroup objects
- Since:
- 4.1.4
-
makeScriptGroupsInfo
public static ScriptGroup[] makeScriptGroupsInfo(org.alfresco.query.PagingResults<AuthorityInfo> pagedGroups, ScriptPagingDetails paging, String sortBy, boolean sortAsc, ServiceRegistry serviceRegistry, org.mozilla.javascript.Scriptable scope) Returns an array of ScriptGroup objects representing the given paged results.- Parameters:
pagedGroups- sorted paged results (the page of results get sorted again taking I18n into account)paging- Object representing the paging detailsserviceRegistry- ServiceRegistryscope- Scriptable- Returns:
- Array of ScriptGroup objects
- Since:
- 4.1.4
-
getZones
Gets all the zones of this group
-
ScriptGroup(String, ServiceRegistry, Scriptable)instead