|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.entity.AbstractBasicEntity
org.torweg.pulse.util.entity.AbstractNamedEntity
org.torweg.pulse.util.entity.AbstractNamableEntity
org.torweg.pulse.accesscontrol.AbstractAccessControlObject
org.torweg.pulse.accesscontrol.Role
@Entity public class Role
A Role is an entity used to combine Groups and Permissions, in order to reduce the number of Group s and Permissions, that have to be assigned to a certain User.
| Constructor Summary | |
|---|---|
protected |
Role()
Deprecated. |
|
Role(java.lang.String nam)
The constructor that sets the name of the Role. |
| Method Summary | |
|---|---|
boolean |
addGroup(Group group)
Adds a Group to the Role's Set of Groups. |
boolean |
addPermission(Permission perm)
Adds a Permission to the Role's Set of Permissions. |
org.jdom.Element |
deserializeToJDOM()
Returns the state of the Role as a JDOM Element . |
java.lang.String |
getDescription()
returns the description. |
java.util.Set<Group> |
getGroups()
Returns a shallow copy of the Role's Collection of
Groups. |
java.util.Set<Permission> |
getPermissions()
Returns a shallow copy of the Role's Collection of
Permissions. |
java.util.List<User> |
getUsers(org.hibernate.Session s)
Returns the Users associated with the Role ordered by
name. |
boolean |
removeGroup(Group grp)
Removes a Group from the Role's Set of Groups if it is part of it. |
boolean |
removePermission(Permission perm)
Removes a Permission from the Role's Set of
Permissions if it is part of it. |
void |
setDescription(java.lang.String d)
sets the description. |
net.sf.json.JSONObject |
toJSON()
Serializes the state of the Role as a JSONObject. |
net.sf.json.JSONObject |
toJSON(org.hibernate.Session s)
Returns the state of the Role as a JSONObject. |
| Methods inherited from class org.torweg.pulse.accesscontrol.AbstractAccessControlObject |
|---|
getAssociatedAbstractAccessControlObjects, getLoadCriteriaForClassWithAlias |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity |
|---|
setName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity |
|---|
getName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity |
|---|
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.torweg.pulse.util.INameable |
|---|
setName |
| Methods inherited from interface org.torweg.pulse.util.INamed |
|---|
getName |
| Constructor Detail |
|---|
@Deprecated protected Role()
public Role(java.lang.String nam)
Role.
nam - the name of the Role.| Method Detail |
|---|
public final java.lang.String getDescription()
public final void setDescription(java.lang.String d)
d - the description to setpublic final java.util.Set<Group> getGroups()
Role's Collection of
Groups.
Groups associated with the Role.public final boolean addGroup(Group group)
Group to the Role's Set of Groups.
If it already is part of the Set, it will not be added.
group - the Group to be added.
true if the Set changed as a result of the call.public final boolean removeGroup(Group grp)
Group from the Role's Set of Groups if it is part of it.
grp - the Group to be removed.
true if the Set changed as a result of the call.public final java.util.Set<Permission> getPermissions()
Role's Collection of
Permissions.
Permissions associated with the Role.public final boolean addPermission(Permission perm)
Permission to the Role's Set of Permissions.
If it already is part of the Set, it will not be added.
perm - the Permission to be added.
true if the Set changed as a result of the call.public final boolean removePermission(Permission perm)
Permission from the Role's Set of
Permissions if it is part of it.
perm - the Permission to be removed.
true if the Set changed as a result of the call.public final java.util.List<User> getUsers(org.hibernate.Session s)
Users associated with the Role ordered by
name.
s - the hibernateTM-Session
Users associated with the Role.public final org.jdom.Element deserializeToJDOM()
Role as a JDOM Element .
deserializeToJDOM in interface JDOMableRole as a JDOM Element .public final net.sf.json.JSONObject toJSON()
Role as a JSONObject.
toJSON in class AbstractAccessControlObjectRole as a JSONObjectpublic final net.sf.json.JSONObject toJSON(org.hibernate.Session s)
Role as a JSONObject.
If a Session is given the number of Users, associated
with the Role will be added to the JSON.
s - the hibernateTM-Session
Role as a JSONObject.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||