Interface PermissionSchemeAttributeManager

All Known Implementing Classes:
DefaultPermissionSchemeAttributeManager

@ExperimentalApi @ParametersAreNonnullByDefault public interface PermissionSchemeAttributeManager
Allows managing permission scheme attributes.
Since:
7.4
  • Method Details

    • getAttribute

      Optional<String> getAttribute(Long schemeId, String key)
      Retrieves attribute value.
      Parameters:
      schemeId - permission scheme id
      key - attribute key
      Returns:
      Optional<String> containing attribute value if it exists or default value if specified
      Optional<String>#empty() if an attribute with the given key was not found for the given scheme and doesn't have specified default value
    • getAttributes

      Map<String,String> getAttributes(Long schemeId)
      Retrieves all attributes for the given permission scheme (including default attributes).
      Parameters:
      schemeId - permission scheme id
      Returns:
      Map<String, String> of attributes' keys and values for the given permission scheme
    • setAttribute

      void setAttribute(Long schemeId, String key, String value)
      Upserts an attribute for the given scheme.
      Parameters:
      schemeId - permission scheme id
      key - attribute key
      value - attribute value
    • updateAttributes

      void updateAttributes(Long schemeId, Map<String,String> attributes)
      Updates ALL attributes for the permission scheme.
      Parameters:
      schemeId - permission scheme id
      attributes - Map<String, String> of all attributes the defined scheme should have, e.g. if this map doesn't contain an existing attribute, it would be deleted
    • deleteAttributes

      void deleteAttributes(Long schemeId, Collection<String> keys)
      Deletes attributes with the defined keys from the permission scheme.
      Parameters:
      schemeId - permission scheme id
      keys - a Collection<String> of attribute keys
    • clearAttributes

      void clearAttributes(Long schemeId)
      Deletes all attributes from the permission scheme.
      Parameters:
      schemeId - permission scheme id
    • getDefaultAttributes

      Map<String,String> getDefaultAttributes()
      Default attributes are meant to exist even if there's no such attribute stored.
      Returns:
      Map<String, String> of default attributes' keys and values