|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openwms.core.domain.AbstractEntity
org.openwms.core.domain.system.usermanagement.SecurityObject
org.openwms.core.domain.system.usermanagement.Role
public class Role
A Role is a group of User
s. Basically more than one
User
belong to a Role. Security access policies are assigned to
Role
s instead of User
s.
SecurityObject
,
User
,
Role
,
Serialized FormNested Class Summary | |
---|---|
static class |
Role.Builder
A builder class to construct Role instances. |
Nested classes/interfaces inherited from class org.openwms.core.domain.AbstractEntity |
---|
AbstractEntity.AbstractEntityListener |
Field Summary | |
---|---|
static String |
NQ_FIND_ALL
Query to find all Role s. |
static String |
NQ_FIND_BY_UNIQUE_QUERY
Query to find one Role by its natural key. |
static String |
ROLE_PREFIX
The default prefix String for each created Role . |
Fields inherited from class org.openwms.core.domain.AbstractEntity |
---|
FIND_ALL, FIND_BY_ID |
Constructor Summary | |
---|---|
Role(String name)
Create a new Role with a name. |
|
Role(String name,
String description)
Create a new Role with a name and a description. |
Method Summary | |
---|---|
boolean |
addGrant(SecurityObject grant)
Add an existing SecurityObject to the Role . |
boolean |
addUser(User user)
Add an existing User to the Role . |
boolean |
equals(Object obj)
Compare the uid property field. |
Set<SecurityObject> |
getGrants()
Return an unmodifiable Set of all SecurityObject s belonging to
the Role . |
Boolean |
getImmutable()
Get the immutable. |
Set<RolePreference> |
getPreferences()
Return all RolePreference s of the Role . |
Set<User> |
getUsers()
Return an unmodifiable Set of all User s assigned to the
Role . |
int |
hashCode()
Use the uid to calculate the hashCode. |
boolean |
removeGrant(SecurityObject grant)
Add an existing SecurityObject to the Role . |
void |
removeUser(User user)
Remove a User from the Role . |
void |
setGrants(Set<SecurityObject> grants)
Set all SecurityObject s assigned to the Role . |
void |
setPreferences(Set<RolePreference> preferences)
Set all RolePreference s belonging to the Role . |
void |
setUsers(Set<User> users)
Set all User s belonging to this Role . |
Methods inherited from class org.openwms.core.domain.system.usermanagement.SecurityObject |
---|
getDescription, getId, getName, getVersion, isNew, setDescription, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ROLE_PREFIX
Role
. Name is * *
* "ROLE_" .
public static final String NQ_FIND_ALL
Role
s. Name is "Role.findAll" .
public static final String NQ_FIND_BY_UNIQUE_QUERY
Role
by its natural key.
Role
to search for.Name is "Role.findByRolename" .
Constructor Detail |
---|
public Role(String name)
Role
with a name.
name
- The name of the Role
IllegalArgumentException
- when name is null
or emptypublic Role(String name, String description)
Role
with a name and a description.
name
- The name of the Role
description
- The description text of the Role
IllegalArgumentException
- when name is null
or emptyMethod Detail |
---|
public Boolean getImmutable()
public Set<User> getUsers()
User
s assigned to the
Role
.
User
s assigned to the Role
public boolean addUser(User user)
User
to the Role
.
user
- The User
to be added
true
if the User
was new in the collection
of User
s, otherwise false
IllegalArgumentException
- if user is null
public void removeUser(User user)
User
from the Role
.
user
- The User
to be removed
IllegalArgumentException
- if user is null
public void setUsers(Set<User> users)
User
s belonging to this Role
.
users
- A Set of User
s to be assigned to the Role
IllegalArgumentException
- if users is null
public Set<RolePreference> getPreferences()
RolePreference
s of the Role
.
RolePreference
s assigned to the
Role
public void setPreferences(Set<RolePreference> preferences)
RolePreference
s belonging to the Role
.
preferences
- A Set of RolePreference
s to be assigned to the
Role
public Set<SecurityObject> getGrants()
SecurityObject
s belonging to
the Role
.
SecurityObject
s belonging to this Rolepublic boolean addGrant(SecurityObject grant)
SecurityObject
to the Role
.
grant
- The SecurityObject
to be added to the
Role
.
true
if the SecurityObject
was new to the
collection of SecurityObject
s, otherwise
false
IllegalArgumentException
- if grant is null
public boolean removeGrant(SecurityObject grant)
SecurityObject
to the Role
.
grant
- The SecurityObject
to be added to the
Role
true
if the SecurityObject
was successfully
removed from the Set of SecurityObject
s, otherwise
false
IllegalArgumentException
- if grant is null
public void setGrants(Set<SecurityObject> grants)
SecurityObject
s assigned to the Role
.
Already existing SecurityObject
s will be removed.
grants
- A Set of SecurityObject
s to be assigned to the
Role
IllegalArgumentException
- if grants is null
public int hashCode()
hashCode
in class SecurityObject
Object.hashCode()
public boolean equals(Object obj)
SecurityObject.equals(Object)
and uses
the name for comparison.
equals
in class SecurityObject
Object.equals(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |