Interface Resource

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    JpaResource, MemoryResource

    public interface Resource
    extends Serializable
    Resource Resources are things that can be paired up with operations inside of a permission. Rbac doesn't strictly specify what a resource (or Object) is, so there are a couple of variations planned for resources. Initially the resource is simply a string representaton of whatever you desire to match up to an operation. Eventually we want to support different types of expression evaluation for these resources, like a tuple resource. *-* where wildcards can be used on the resource definition to streamline the assigning of permissions for _large_ sets of things. The GLOBAL resource is a catch-all for all resource strings.
    Author:
    Jesse McConnell, Joakim Erdfelt
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String GLOBAL
      Resource identifier refering to all objects.
      static String NULL
      Resource identifier refering to no objects.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String getIdentifier()
      Get The string identifier for an operation.
      boolean isPattern()
      true if the identifer is a pattern that is to be evaluated, for example x.* could match x.a or x.b and x.** could match x.foo Jesse: See setPattern(boolean)
      boolean isPermanent()
      Test to see if the object is a permanent object or not.
      void setIdentifier​(String identifier)
      Set The string identifier for an operation.
      void setPattern​(boolean pattern)
      true if the identifer is a pattern that is to be evaluated, for example x.* could match x.a or x.b and x.** could match x.foo TODO is this even a good idea? TODO we could look for a character like '*' or a string starting with "%/" to indicate if this is a pattern or not.
      void setPermanent​(boolean permanent)
      Set flag indicating if the object is a permanent object or not.
    • Method Detail

      • getIdentifier

        String getIdentifier()
        Get The string identifier for an operation. NOTE: This field is considered the Primary Key for this object.
      • isPattern

        boolean isPattern()
        true if the identifer is a pattern that is to be evaluated, for example x.* could match x.a or x.b and x.** could match x.foo Jesse: See setPattern(boolean)
      • setIdentifier

        void setIdentifier​(String identifier)
        Set The string identifier for an operation. NOTE: This field is considered the Primary Key for this object.
        Parameters:
        identifier -
      • setPattern

        void setPattern​(boolean pattern)
        true if the identifer is a pattern that is to be evaluated, for example x.* could match x.a or x.b and x.** could match x.foo TODO is this even a good idea? TODO we could look for a character like '*' or a string starting with "%/" to indicate if this is a pattern or not.
        Parameters:
        pattern -
      • isPermanent

        boolean isPermanent()
        Test to see if the object is a permanent object or not.
        Returns:
        true if the object is permanent.
      • setPermanent

        void setPermanent​(boolean permanent)
        Set flag indicating if the object is a permanent object or not.
        Parameters:
        permanent - true if the object is permanent.