Interface ScopeResolver


public interface ScopeResolver
A product-agnostic service for obtaining Scope objects by name.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the set of scopes for this product
    getScope(String scopeName)
    Will try to get the scope from the name.
    boolean
    hasScopePermission(Scope tokenScope, Scope configScope)
    Will check if the tokenScope has permission against the configScope If the tokenScope is higher than the configScope then this will return false
  • Method Details

    • getScope

      Scope getScope(String scopeName) throws InvalidScopeException
      Will try to get the scope from the name.
      Parameters:
      scopeName - the scope name to match
      Returns:
      The scope that matches the scopeName
      Throws:
      InvalidScopeException - if fails to find the scope
      See Also:
    • hasScopePermission

      boolean hasScopePermission(Scope tokenScope, Scope configScope)
      Will check if the tokenScope has permission against the configScope If the tokenScope is higher than the configScope then this will return false
      Parameters:
      tokenScope - the scope to check
      configScope - the scope to check against
      Returns:
      true if tokenScope is within configScope, false otherwise
    • getAvailableScopes

      Set<Scope> getAvailableScopes()
      Gets the set of scopes for this product
      Returns:
      the set of scopes for this product