Package com.atlassian.application.api
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents the different types of access error. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUserAccessApplication(com.atlassian.sal.api.user.UserKey userKey) Returnstrueif the user actually able to use the associatedApplication.io.atlassian.fugue.Option<ApplicationAccess.AccessError>getAccessError(com.atlassian.sal.api.user.UserKey userKey) Returns the most important reason why the passed user cannot access theApplication.intReturns the number of users who are currently able to access the associatedApplication.Get theApplicationKeyof theApplicationwhose access control is managed by this instance.Returns a relative URI to a screen where administrators can manage application access.io.atlassian.fugue.Option<Integer>Return the maximum number of users that can be given access to theApplication.
-
Method Details
-
getApplicationKey
ApplicationKey getApplicationKey()Get theApplicationKeyof theApplicationwhose access control is managed by this instance.- Returns:
- the
ApplicationKeyof theApplicationwhose 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 theApplication.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 associatedApplication.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) Returnstrueif the user actually able to use the associatedApplication. This method returnstruewhengetAccessError().isEmpty()istrue.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.nullrepresents 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 theApplication.Option.none()will be returned if the user can access theApplication.- Parameters:
userKey- the user key.nullrepresents the anonymous user.- Returns:
- The reason why the user cannot access the
ApplicationorOption.none()if the user is able to access theProduct.
-
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.
-