@MappedSuperclass public class Role extends ModelObject
Authorization
s for Authorizable
components. The Role is an umbrella definition of Authorizations available to the server.
If a User is assigned a Role, then the Role is validated against the service and expanded to its actual set of Authorizations.
Role
s are equal if their name
s are exactly equal. While comparing roles their individual compositions are ignored by default.
The reason is Authorizations based on role comparisons are usually based on name; the idea of using a Role in the first place is to roll-up into a single name. However this also assumes that role requests
are trusted to ask by name. If not, one may want to override this. See equals(Object)
for the implementation if this needs to be overriden.Constructor and Description |
---|
Role() |
Role(Map<Authorizable,Collection<Authorization>> authorizations) |
Role(Role role) |
Role(String name) |
Role(String name,
Map<Authorizable,Collection<Authorization>> authorizations) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Map<Authorizable,Collection<Authorization>> |
getAuthorizations()
Map for an
Authorizable what are the Authorization s this Role represents.The Map itself is transient, if Role to be persisted then save as JSON and marshal/unmarshal to this. |
Supplier |
getEnvironmentSupplier()
When role is active, it loads this context and supplies it to the Session.
Example: What is the default page for the Role etc. |
String |
getName() |
int |
hashCode() |
void |
setAuthorizations(Map<Authorizable,Collection<Authorization>> authorizations)
Map for an
Authorizable what are the Authorization s this Role represents.The Map itself is transient, if Role to be persisted then save as JSON and marshal/unmarshal to this. |
void |
setName(String name) |
public Role()
public Role(String name)
public Role(Role role)
public Role(Map<Authorizable,Collection<Authorization>> authorizations)
public Role(String name, Map<Authorizable,Collection<Authorization>> authorizations)
public String getName()
public void setName(String name)
public Map<Authorizable,Collection<Authorization>> getAuthorizations()
Authorizable
what are the Authorization
s this Role represents.Map
itself is transient, if Role to be persisted then save as JSON and marshal/unmarshal to this.public void setAuthorizations(Map<Authorizable,Collection<Authorization>> authorizations)
Authorizable
what are the Authorization
s this Role represents.Map
itself is transient, if Role to be persisted then save as JSON and marshal/unmarshal to this.public Supplier getEnvironmentSupplier()
Copyright © 2018. All rights reserved.