|
|
|
|
|
||||||||||
| 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.Permission
@Entity public class Permission
A Permission is an entity used to restrict the excecution of Commands.
This is done by linking Permissions with CommandMatchers,
Groups and Users. In order to find out if a User has
the allowance for a Command, his Permissions (including those
he gains through his associated Groups) have to be compared to the
Permissions of the CommandMatchers matching the Command. If the CommandMatchers' set of Permissions is a
subset of the User's set of Permissions, the User has
the allowance for the Command.
| Constructor Summary | |
|---|---|
protected |
Permission()
Deprecated. |
|
Permission(java.lang.String newName)
The Constructor that sets the name of the Permission. |
| Method Summary | |
|---|---|
protected boolean |
addCommandMatcher(CommandMatcher matcher)
Adds a CommandMatcher to the Permission's Set of
CommandMatchers. |
org.jdom.Element |
deserializeToJDOM()
Serializes the state of the Permission as a JDOM Element. |
java.util.Set<CommandMatcher> |
getCommandMatchers()
Returns a shallow copy of the Permission's Collection of
CommandMatchers. |
java.lang.String |
getDescription()
returns the description. |
java.util.List<Group> |
getGroups(org.hibernate.Session s)
Returns the Groups associated with the Permission ordered
by name. |
java.util.List<Role> |
getRoles(org.hibernate.Session s)
Returns the Roles associated with the Permission ordered
by name. |
java.util.List<User> |
getUsers(org.hibernate.Session s)
Returns the Users associated with the Permission ordered
by name. |
boolean |
removeCommandMatcher(CommandMatcher matcher)
Removes a CommandMatcher from the Permission's Set of CommandMatchers 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 Permission as a JSONObject. |
net.sf.json.JSONObject |
toJSON(org.hibernate.Session s)
Serializes the state of the Permission 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 Permission()
public Permission(java.lang.String newName)
Constructor that sets the name of the Permission.
newName - the name of the Permission| 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<CommandMatcher> getCommandMatchers()
Permission's Collection of
CommandMatchers.
Attention: Since the returned Set is not a reference to the
Permission's internal Collection, any modifications to
its state will get lost. However, modifications to the state of the
Set's elements will be consistent.
For example: Adding/Deleting a CommandMatcher to/from the Set will not have any effect, when the Permission is saved. On
the other hand, modifications to a CommandMatcher in the Set will be made persistent, when the CommandMatcher is saved.
CommandMatchers associated with the Permissionprotected final boolean addCommandMatcher(CommandMatcher matcher)
CommandMatcher to the Permission's Set of
CommandMatchers. If it already is part of the Set, it
will not be added.
matcher - the CommandMatcher to be added
Set changed as a result of the callpublic final boolean removeCommandMatcher(CommandMatcher matcher)
CommandMatcher from the Permission's Set of CommandMatchers if it is part of it.
matcher - the CommandMatcher to be removed
Set changed as a result of the callpublic final java.util.List<Group> getGroups(org.hibernate.Session s)
Groups associated with the Permission ordered
by name.
s - the hibernateTM-Session
Groups associated with the Permissionpublic final java.util.List<Role> getRoles(org.hibernate.Session s)
Roles associated with the Permission ordered
by name.
s - the hibernateTM-Session
Roles associated with the Permissionpublic final java.util.List<User> getUsers(org.hibernate.Session s)
Users associated with the Permission ordered
by name.
s - the hibernateTM-Session
Users associated with the Permissionpublic final org.jdom.Element deserializeToJDOM()
Permission as a JDOM Element.
deserializeToJDOM in interface JDOMablePermission as a JDOM Elementpublic final net.sf.json.JSONObject toJSON()
Permission as a JSONObject.
toJSON in class AbstractAccessControlObjectPermission as a JSONObjectpublic final net.sf.json.JSONObject toJSON(org.hibernate.Session s)
Permission as a JSONObject.
If a Session is given the number of Users, Groups
and Roles associated with the Permission will be added to
the JSON.
s - the hibernateTM-Session
Permission as a JSONObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||