|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.domain.DomainObject
com.arsdigita.kernel.Role
Represents a role within a group. The class of users who have a given role within a group are treated as a party, so that permissions can be assigned to a role within a group.
This class has not yet been reviewed and is subject to change.
Group.createRole(String)
Field Summary | |
static String |
versionId
|
Constructor Summary | |
Role(BigDecimal id)
Wrapper for Role(OID) . |
|
Role(DataObject dataObject)
Constructor. |
|
Role(OID oid)
Constructor. |
Method Summary | |
void |
add(Party party)
Adds a party to this role. |
void |
addMember(User user)
Deprecated. Use Role.add() |
protected void |
beforeSave()
Persists any changes made to this object. |
boolean |
checkPermission(ACSObject target,
PrivilegeDescriptor priv)
Checks whether users in this role have the specified PrivilegeDescriptor on the specified target ACS object. |
boolean |
checkPermission(PrivilegeDescriptor priv)
Wrapper to check a PrivilegeDescriptor for users in this role on the group that represents the people in this role. |
void |
delete()
Deletes this role and all the users in it. |
protected String |
getBaseDataObjectType()
Returns the base data object type for this domain object class. |
GroupCollection |
getContainedGroups()
Returns a collection of groups that belong to this role. |
PartyCollection |
getContainedParties()
Returns a collection of parties (users and subgroups) that belong to this role. |
UserCollection |
getContainedUsers()
Returns a collection of users that are direct members in this role. |
String |
getDescription()
Gets the description of this role. |
Group |
getGroup()
Gets the group that represents the members of this role. |
BigDecimal |
getID()
Gets the ID of this role. |
UserCollection |
getMemberUsers()
Deprecated. Use Role.getContainedUsers() |
String |
getName()
Gets the name of this role. |
void |
grantPermission(ACSObject target,
PrivilegeDescriptor priv)
Grants users in this role the specified privilege on the specified target ACS object. |
void |
grantPermission(PrivilegeDescriptor priv)
Wrapper to grant a PrivilegeDescriptor to users in this role on the group that represents the people in this role. |
protected void |
initialize()
Called from all of the DomainObject constructors
to initalize or validate the new domain object or its
encapsulated data object. |
void |
remove(Party party)
Removes a party from this role. |
void |
removeMember(User user)
Deprecated. Use Role.remove() |
void |
revokePermission(ACSObject target,
PrivilegeDescriptor priv)
Revokes the specified PrivilegeDescriptor on the specified target ACS object for users who have this role. |
void |
revokePermission(PrivilegeDescriptor priv)
Revokes the specified PrivilegeDescriptor on the group representing people in this role for users who have this role. |
void |
setDescription(String description)
Sets the description of this role. |
void |
setName(String name)
Sets the name of this role. |
Methods inherited from class com.arsdigita.domain.DomainObject |
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public Role(DataObject dataObject)
dataObject
- The data object to use to create this roleDomainObject.DomainObject(DataObject)
public Role(OID oid) throws DataObjectNotFoundException
DataObject
is retrieved
from the persistent storage mechanism with an OID
specified by oid.
oid
- the OID
for the retrieved
DataObject
DomainObject.DomainObject(OID)
,
DataObject
,
OID
public Role(BigDecimal id) throws DataObjectNotFoundException
Role(OID)
.
Method Detail |
protected String getBaseDataObjectType()
DomainObject
getBaseDataObjectType
in class DomainObject
protected void initialize()
DomainObject
DomainObject
constructors
to initalize or validate the new domain object or its
encapsulated data object. This was introduced in order to
support efficient validation of the encapsualted data object's
type. If the validation is typically performed in class
constructors, then redundant validation is performed in
superclass constructors. This validation now occurs here.
initialize
in class DomainObject
public BigDecimal getID()
public void setName(String name)
name
- the name of this rolepublic String getName()
public void setDescription(String description)
description
- the description of this rolepublic String getDescription()
public UserCollection getMemberUsers()
public UserCollection getContainedUsers()
public GroupCollection getContainedGroups()
public PartyCollection getContainedParties()
public void add(Party party)
party
- the party to add to this rolepublic void remove(Party party)
party
- the party to remove from this rolepublic void addMember(User user)
user
- the user to add to this rolepublic void removeMember(User user)
user
- the user to remove from this roleprotected void beforeSave()
beforeSave
in class DomainObject
DataObject.save()
public void delete() throws PersistenceException
delete
in class DomainObject
PersistenceException
DataObject.delete()
public void grantPermission(ACSObject target, PrivilegeDescriptor priv)
target
- the ACS object on which to grant the privilegepriv
- the privilege to grantPermissionService.grantPermission(PermissionDescriptor)
public void grantPermission(PrivilegeDescriptor priv)
priv
- the privilege to grantpublic boolean checkPermission(ACSObject target, PrivilegeDescriptor priv)
target
- the ACS object to checkpriv
- the privilege to check for
true
if the users have the PrivilegeDescriptor
on the specified target; false
otherwise.PermissionService.checkPermission(PermissionDescriptor)
public boolean checkPermission(PrivilegeDescriptor priv)
public void revokePermission(ACSObject target, PrivilegeDescriptor priv)
target
- the ACS object that has the privilege to revokepriv
- the privilege to revokePermissionService.revokePermission(PermissionDescriptor)
public void revokePermission(PrivilegeDescriptor priv)
priv
- the privilege to revokePermissionService.revokePermission(PermissionDescriptor)
public Group getGroup()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |