Package org.appng.api.model
Interface Authorizable<T extends Serializable>
-
- All Superinterfaces:
Identifiable<T>,Nameable,Named<T>,Serializable
public interface Authorizable<T extends Serializable> extends Named<T>
If aApplicationwant's to authorize a domain object to severalRoles, the domain-object needs to implementAuthorizable.
TheRoles provided by theApplicationcan be obtained by callingApplication.getRoles(). Since theRoles are maintained by appNG and not by theApplicationitself, theAuthorizablejust needs to maintain the IDs of the authorizedRoles.
When using JPA for persisting domain objects, this can easily be done by using ajavax.persistence.ElementCollection.@ElementCollection public List<Integer> getRoleIds() { return roleIds; }- Author:
- Matthias Müller
- See Also:
Subject.isAuthorized(Authorizable),Application.getRoles()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Integer>getRoleIds()Returns a list containing the IDs of allRoles which are authorized to access thisAuthorizable.-
Methods inherited from interface org.appng.api.model.Identifiable
getId
-
Methods inherited from interface org.appng.api.model.Nameable
getDescription, getName
-
-
-
-
Method Detail
-
getRoleIds
List<Integer> getRoleIds()
Returns a list containing the IDs of allRoles which are authorized to access thisAuthorizable.- Returns:
- a list containing the IDs of all
Roles which are authorized to access thisAuthorizable
-
-