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

  • Constructor Details

    • BasicAccessControlService

      public BasicAccessControlService()
      Constructor.
  • Method Details

    • setPolicyMap

      public void setPolicyMap​(@Nonnull @NonnullElements Map<String,​AccessControl> map)
      Set the policies to store.
      Parameters:
      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
      Parameters:
      name - policy name
      Returns:
      the matching instance, or a default