org.alfresco.repo.security.authority.script
Class ScriptGroup

java.lang.Object
  extended by org.alfresco.repo.security.authority.script.ScriptGroup
All Implemented Interfaces:
java.io.Serializable, Authority

public class ScriptGroup
extends java.lang.Object
implements Authority, java.io.Serializable

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.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.security.authority.script.Authority
Authority.ScriptAuthorityType
 
Constructor Summary
ScriptGroup(java.lang.String fullName, AuthorityService authorityService)
          New script group
 
Method Summary
 void addAuthority(java.lang.String fullAuthorityName)
          AddAuthority as a child of this group
 ScriptGroup createGroup(java.lang.String shortName, java.lang.String displayName)
          Create a new group as a child of this group.
 void deleteGroup()
          Delete this group
 ScriptGroup[] getAllGroups()
          Get all sub groups (all decendants)
 ScriptGroup[] getAllParentGroups()
          Get all the parents of this this group
 ScriptUser[] getAllUsers()
          Get all users contained in this group
 Authority.ScriptAuthorityType getAuthorityType()
           
 Authority[] getChildAuthorities()
          Get all the children of this group, regardless of type
 ScriptGroup[] getChildGroups()
           
 ScriptUser[] getChildUsers()
           
 java.lang.String getDisplayName()
           
 java.lang.String getFullName()
           
 int getGroupCount()
          Get the number of child groups contained within this group.
 ScriptGroup[] getParentGroups()
          Get the immediate parents of this group
 java.lang.String getShortName()
           
 int getUserCount()
          Get the number of users contained within this group.
 boolean isAdminGroup()
          Is this an admin group?
 boolean isRootGroup()
          Is this a root group?
 void removeAuthority(java.lang.String fullAuthorityName)
          Remove child Authority from this group
 void removeGroup(java.lang.String shortName)
          remove sub group from this group
 void removeUser(java.lang.String shortName)
          Remove child user from this group
 void setAuthorityType(Authority.ScriptAuthorityType authorityType)
           
 void setDisplayName(java.lang.String displayName)
          Change the display name for this group.
 void setFullName(java.lang.String fullName)
           
 void setShortName(java.lang.String shortName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptGroup

public ScriptGroup(java.lang.String fullName,
                   AuthorityService authorityService)
New script group

Parameters:
fullName -
authorityService -
Method Detail

deleteGroup

public void deleteGroup()
Delete this group


setAuthorityType

public void setAuthorityType(Authority.ScriptAuthorityType authorityType)

getAuthorityType

public Authority.ScriptAuthorityType getAuthorityType()
Specified by:
getAuthorityType in interface Authority

setShortName

public void setShortName(java.lang.String shortName)

getShortName

public java.lang.String getShortName()
Specified by:
getShortName in interface Authority

setFullName

public void setFullName(java.lang.String fullName)

getFullName

public java.lang.String getFullName()
Specified by:
getFullName in interface Authority

setDisplayName

public void setDisplayName(java.lang.String displayName)
Change the display name for this group. Need administrator permission to call this method to change a display name.

Parameters:
displayName -

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface Authority

getAllUsers

public ScriptUser[] getAllUsers()
Get all users contained in this group

Returns:

getAllGroups

public ScriptGroup[] getAllGroups()
Get all sub groups (all decendants)

Returns:
the descenants of this group

getChildUsers

public ScriptUser[] getChildUsers()

getChildGroups

public ScriptGroup[] getChildGroups()

getParentGroups

public ScriptGroup[] getParentGroups()
Get the immediate parents of this group

Returns:
the immediate parents of this group

getAllParentGroups

public ScriptGroup[] getAllParentGroups()
Get all the parents of this this group

Returns:
all the parents of this group

getChildAuthorities

public Authority[] getChildAuthorities()
Get all the children of this group, regardless of type


isRootGroup

public boolean isRootGroup()
Is this a root group?

Returns:

isAdminGroup

public boolean isAdminGroup()
Is this an admin group?

Returns:

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

public ScriptGroup createGroup(java.lang.String shortName,
                               java.lang.String displayName)
Create a new group as a child of this group.

Returns:
the new group

removeGroup

public void removeGroup(java.lang.String shortName)
remove sub group from this group

Parameters:
shortName - the shortName of the sub group to remove from this group.

removeUser

public void removeUser(java.lang.String shortName)
Remove child user from this group

Parameters:
shortName - the shortName of the user to remove from this group.

addAuthority

public void addAuthority(java.lang.String fullAuthorityName)
AddAuthority as a child of this group

Parameters:
fullAuthorityName - the full name of the authority to add to this group.

removeAuthority

public void removeAuthority(java.lang.String fullAuthorityName)
Remove child Authority from this group

Parameters:
fullAuthorityName - the full name of the authority to remove from this group.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.