Interface ApplicationAccess


public interface ApplicationAccess
Represents the access control to a Application (e.g. Service Desk) installed on top of a platform (e.g. JIRA). Note, this is not a specific licensing check, as long as there is a license that can grant access present then there will be no access errors. That is, the access may not come from the license of the specific application being checked. Unless otherwise noted none of the parameters or return values can be null.
Since:
v1.0
  • Method Details

    • getApplicationKey

      ApplicationKey getApplicationKey()
      Get the ApplicationKey of the Application whose access control is managed by this instance.
      Returns:
      the ApplicationKey of the Application whose access control is managed by this instance.
    • getMaximumUserCount

      io.atlassian.fugue.Option<Integer> getMaximumUserCount()
      Return the maximum number of users that can be given access to the Application. Option.none() is returned to indicate there is no maximum.
      Returns:
      the maximum number of users that can be given access to the application. Option.none() is returned to indicate there is no maximum.
    • getActiveUserCount

      int getActiveUserCount()
      Returns the number of users who are currently able to access the associated Application.

      This function may be called frequently; it is strongly recommended that implementations use a caching strategy to reduce the cost of repeated calls.

      Returns:
      the number of users configured for access to the associated Application.
    • canUserAccessApplication

      boolean canUserAccessApplication(@Nullable com.atlassian.sal.api.user.UserKey userKey)
      Returns true if the user actually able to use the associated Application. This method returns true when getAccessError().isEmpty() is true.

      This function may be called frequently; it is strongly recommended that implementations use a caching strategy to reduce the cost of repeated calls.

      Parameters:
      userKey - the user key. null represents the anonymous user.
      Returns:
      true if the given user can access the associated Application.
    • getAccessError

      io.atlassian.fugue.Option<ApplicationAccess.AccessError> getAccessError(@Nullable com.atlassian.sal.api.user.UserKey userKey)
      Returns the most important reason why the passed user cannot access the Application. Option.none() will be returned if the user can access the Application.
      Parameters:
      userKey - the user key. null represents the anonymous user.
      Returns:
      The reason why the user cannot access the Application or Option.none() if the user is able to access the Product.
    • getManagementPage

      URI getManagementPage()
      Returns a relative URI to a screen where administrators can manage application access.

      The URI must reference a page on the current application instance.

      This URI should not include the application's context path if one exists.

      Returns:
      a relative URI to a screen where administrators can manage users in this application.