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 aApplication
want's to authorize a domain object to severalRole
s, the domain-object needs to implementAuthorizable
.
TheRole
s provided by theApplication
can be obtained by callingApplication.getRoles()
. Since theRole
s are maintained by appNG and not by theApplication
itself, theAuthorizable
just needs to maintain the IDs of the authorizedRole
s.
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 allRole
s 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 allRole
s which are authorized to access thisAuthorizable
.- Returns:
- a list containing the IDs of all
Role
s which are authorized to access thisAuthorizable
-
-