Class BasicAccessControlService

All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent, UnmodifiableComponent, AccessControlService

public class BasicAccessControlService extends AbstractIdentifiableInitializableComponent implements AccessControlService
Simple implementation that uses an in-memory map of policies.
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • policyMap

      @Nonnull private Map<String,AccessControl> policyMap
      Map of named policies.
  • Constructor Details

    • BasicAccessControlService

      public BasicAccessControlService()
  • Method Details

    • setPolicyMap

      public void setPolicyMap(@Nullable Map<String,AccessControl> map)
      Set the policies to store.
      map - map of named policies
    • getInstance

      @Nonnull public AccessControl getInstance(@Nonnull String name)
      Get an AccessControl instance matching a given name.

      In the absence of a matching instance, a default policy that denies access is returned.

      Specified by:
      getInstance in interface AccessControlService
      name - policy name
      the matching instance, or a default