Class BaseDatabaseRoleProvider<T extends BaseRole>

java.lang.Object
io.jmix.securitydata.impl.role.provider.BaseDatabaseRoleProvider<T>
All Implemented Interfaces:
RoleProvider<T>
Direct Known Subclasses:
DatabaseResourceRoleProvider, DatabaseRowLevelRoleProvider

public abstract class BaseDatabaseRoleProvider<T extends BaseRole> extends Object implements RoleProvider<T>
Base role provider that gets resource roles/row level roles from the database.
  • Field Details

  • Constructor Details

    • BaseDatabaseRoleProvider

      public BaseDatabaseRoleProvider()
  • Method Details

    • getAllRoles

      public @NonNull Collection<T> getAllRoles()
      Specified by:
      getAllRoles in interface RoleProvider<T extends BaseRole>
    • getAllRoles

      public @NonNull Collection<T> getAllRoles(boolean includePolicies)
      Description copied from interface: RoleProvider
      Returns all roles. When includePolicies is false, implementations may skip loading role policies to speed up listing scenarios that do not need them.
      Specified by:
      getAllRoles in interface RoleProvider<T extends BaseRole>
    • findRoleByCode

      public @Nullable T findRoleByCode(@NonNull String code)
      Specified by:
      findRoleByCode in interface RoleProvider<T extends BaseRole>
    • deleteRole

      public boolean deleteRole(@NonNull T role)
      Specified by:
      deleteRole in interface RoleProvider<T extends BaseRole>
    • setDataManager

      @Autowired public void setDataManager(UnconstrainedDataManager dataManager)
    • setMetadata

      @Autowired public void setMetadata(Metadata metadata)
    • setAccessManager

      @Autowired public void setAccessManager(AccessManager accessManager)
    • buildRole

      protected abstract T buildRole(Object entity)
    • buildRole

      protected T buildRole(Object entity, boolean includePolicies)
    • getRoleClass

      protected abstract Class<?> getRoleClass()
    • buildFetchPlan

      protected abstract void buildFetchPlan(FetchPlanBuilder fetchPlanBuilder)
    • buildFetchPlan

      protected void buildFetchPlan(FetchPlanBuilder fetchPlanBuilder, boolean includePolicies)
    • buildFindByCodeQuery

      protected String buildFindByCodeQuery()
    • checkLocalizedValues

      protected void checkLocalizedValues(T role)
      Logs the localized values of the role that cannot be read. The role keeps them as they are stored and is shown with its default texts instead. The role is reported here, where its code is known, rather than every time it is shown, and at WARN once for the same values: lists build their roles on every load, so the values are logged at DEBUG afterwards until they change.
    • checkLocalizedValuesInternal

      protected void checkLocalizedValuesInternal(T role, String property, @Nullable String localizedValues)