Class RoleConfig

java.lang.Object
org.trustdeck.configuration.RoleConfig

@Configuration @ConfigurationProperties(prefix="app") public class RoleConfig extends Object
Configuration class that holds the operational roles for the application. This class is used to map configuration properties defined under the `app` prefix in the application’s configuration file (e.g., `application.yml` or `application.properties`). It contains a list of role names that define the operations required by the application. For example, a configuration in `application.yml` might look like:
 app:
   roles:
     ACE:
       - domain-create
       - domain-read
       ...
     KING:
       - project-create
       - project-read
       ...
     administrative:
       - permission-manager
       - delete-roles
 
Author:
Eric Wündisch and Armin Müller
  • Field Details

    • ADMINISTRATIVE_ROLES_GROUP_KEY

      public static final String ADMINISTRATIVE_ROLES_GROUP_KEY
      The key to extract the administrative roles from the yml.
      See Also:
    • ACE_ROLES_GROUP_KEY

      public static final String ACE_ROLES_GROUP_KEY
      The key to extract the ACE-specific roles from the yml.
      See Also:
    • KING_ROLES_GROUP_KEY

      public static final String KING_ROLES_GROUP_KEY
      The key to extract the KING-specific roles from the yml.
      See Also:
  • Constructor Details

    • RoleConfig

      public RoleConfig()
  • Method Details

    • getRoleSublist

      public List<String> getRoleSublist(String groupName)
      Retrieves the roles for a group defined by it's name (e.g. "ACE").
      Parameters:
      groupName - the name that indicates the sublist of roles
      Returns:
      a list of roles found
    • getACERoles

      public List<String> getACERoles()
      Retrieves the roles for ACE.
      Returns:
      a list of roles found
    • getKINGRoles

      public List<String> getKINGRoles()
      Retrieves the roles for KING.
      Returns:
      a list of roles found
    • getAdministrativeRoles

      public List<String> getAdministrativeRoles()
      Retrieves the roles for for KING.
      Returns:
      a list of roles found
    • getAllRoles

      public List<String> getAllRoles()
      Returns a list of all defined roles including all administrative roles.
      Returns:
      a list of all roles defined in the application.yml