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 a `Application` want's to authorize a domain object to several `Role`s, the domain-object needs to implement `Authorizable`.
  The `Role`s provided by the `Application` can be obtained by calling `Application.getRoles()`. Since the `Role`s are maintained by appNG and not by the `Application` itself, the `Authorizable` just needs to maintain the IDs of the authorized `Role`s.
  When using JPA for persisting domain objects, this can easily be done by using a `javax.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 and Description
    --- | ---
    `List<Integer>` | `getRoleIds()` Returns a list containing the IDs of all `Role`s which are authorized to access this `Authorizable`.

    - ### Methods inherited from interface org.appng.api.model.Nameable

      `getDescription, getName`

    - ### Methods inherited from interface org.appng.api.model.Identifiable

      `getId`

- - ### Method Detail

    - #### getRoleIds

          List<Integer> getRoleIds()

      Returns a list containing the IDs of all `Role`s which are authorized to access this `Authorizable`.
      Returns:
        a list containing the IDs of all `Role`s which are authorized to access this `Authorizable`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.