com.atlassian.bitbucket.permission.PermissionValidationService |
A utility service for plugin developer to validate that the current user has a specific permission.
This service uses the PermissionService
to check for a permission and will throw
AuthorisationException
for any failed permission check.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Validate that the user is logged in
| |||||||||||
Validate that the current user has the specified global permission
| |||||||||||
Validate that the current user has the specified permission for the project
| |||||||||||
Validate that the current user has the specified permission for the project
| |||||||||||
Validate that the current user has the specified permission for the repository
Note that anonymous users accessing a public repository do not have the | |||||||||||
Validate that the current user has the specified permission for the repository
Note that anonymous users accessing a public repository do not have the | |||||||||||
Validate that the current user has the specified permission for the target user.
| |||||||||||
Validate that the current user has the specified permission for itself
| |||||||||||
Validate that the current user has the specified permission for the target user.
| |||||||||||
Validate that the current user (authenticated or not) has access to the given repository.
| |||||||||||
Validate that the current user (authenticated or not) has access to the given repository.
|
Validate that the current user has the specified global permission
permission | the requested permission. Must not be null and isGlobal()
must be true |
---|
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user has the specified permission for the project
projectId | the ID of the target project |
---|---|
permission | the requested permission. Must not be null and isGlobal()
must be false |
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user has the specified permission for the project
project | the target project. Must not be null |
---|---|
permission | the requested permission. Must not be null and isGlobal()
must be false |
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user has the specified permission for the repository
Note that anonymous users accessing a public repository do not have the REPO_READ
permission. To perform read access validation that includes public repository access by anonymous users
see validateRepositoryAccessible(Repository)
.
repository | the target repository. Must not be null |
---|---|
permission | the requested permission. Must not be null and isGlobal()
must be false |
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user has the specified permission for the repository
Note that anonymous users accessing a public repository do not have the REPO_READ
permission. To perform read access validation that includes public repository access by anonymous users
see validateRepositoryAccessible(int)
.
repositoryId | the ID of the target repository |
---|---|
permission | the requested permission. Must not be null and isGlobal()
must be false |
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user has the specified permission for the target user.
targetUser | the target user. Must not be null |
---|---|
permission | the requested permission. Must not be null and isGlobal()
must be false |
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user has the specified permission for itself
permission | the requested permission. Must not be null and isGlobal()
must be false |
---|
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user has the specified permission for the target user.
targetUserId | the ID of the target user |
---|---|
permission | the requested permission. Must not be null and isGlobal()
must be false |
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user (authenticated or not) has access to the given repository.
See isRepositoryAccessible(Repository)
for a description of what
constitutes "access".
repository | the target repository. Must not be null |
---|
AuthorisationException | if the current user is unauthorized |
---|
Validate that the current user (authenticated or not) has access to the given repository.
See isRepositoryAccessible(int)
for a description of what constitutes
"access".
repositoryId | the ID of the target repository |
---|
AuthorisationException | if the current user is unauthorized |
---|