Class OAuthPermission

  • All Implemented Interfaces:
    Serializable

    @Entity
    public class OAuthPermission
    extends Object
    implements Serializable
    Provides the complete information about a given opaque permission. For example, a scope parameter such as "read_calendar" will be translated into the instance of this class in order to provide the human readable description and optionally restrict it to a limited set of HTTP verbs and request URIs
    See Also:
    Serialized Form
    • Constructor Detail

      • OAuthPermission

        public OAuthPermission()
      • OAuthPermission

        public OAuthPermission​(String permission)
      • OAuthPermission

        public OAuthPermission​(String permission,
                               String description)
    • Method Detail

      • getHttpVerbs

        public List<String> getHttpVerbs()
        Gets the optional list of HTTP verbs
        Returns:
        the list of HTTP verbs
      • setHttpVerbs

        public void setHttpVerbs​(List<String> httpVerbs)
        Sets the optional list of HTTP verbs, example, "GET" and "POST", etc
        Parameters:
        httpVerbs - the list of HTTP verbs
      • getUris

        public List<String> getUris()
        Gets the optional list of relative request URIs
        Returns:
        the list of URIs
      • setUris

        public void setUris​(List<String> uri)
        Sets the optional list of relative request URIs
        Parameters:
        uri - the list of URIs
      • getDescription

        public String getDescription()
        Gets the permission description
        Returns:
        the description
      • setDescription

        public void setDescription​(String description)
        Sets the permission description
        Parameters:
        description -
      • getPermission

        public String getPermission()
        Get the permission value such as "read_calendar"
        Returns:
        the value
      • setPermission

        public void setPermission​(String permission)
        Sets the permission value such as "read_calendar"
        Parameters:
        permission - the permission value
      • setDefaultPermission

        public void setDefaultPermission​(boolean value)
        Indicates if this permission has been allocated by default or not. Authorization View handlers may use this property to optimize the way the user selects the scopes. For example, assume that read', 'add' and 'update' scopes are supported and the 'read' scope is always allocated. This can be presented at the UI level as follows: the read-only check-box control will represent a 'read' scope and a user will be able to optionally select 'add' and/or 'update' scopes, in addition to the default 'read' one.
        Parameters:
        value - true if the permission has been allocated by default
      • isDefaultPermission

        public boolean isDefaultPermission()
      • isInvisibleToClient

        public boolean isInvisibleToClient()
      • setInvisibleToClient

        public void setInvisibleToClient​(boolean invisibleToClient)
        Set the visibility status; by default all the scopes approved by a user can be optionally reported to the client in access token responses. Some scopes may need to stay 'invisible' to client.
        Parameters:
        invisibleToClient -
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object