Interface AccessChecker
-
- All Known Implementing Classes:
ServerAccessChecker
public interface AccessChecker
This service should be used to perform various security-related asserts. Under the hood it does the following: - checks whether the given action is allowed by the server responsibilities and throwsMissingServerResponsibilityException
if not - checks whether current authority can perform the action and throwsAccessDeniedException
if not The instance can be obtained bySecurityContextEx.getAccessChecker()
or injected as a spring bean.- Since:
- 2018.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkAdminSpaceAvailable()
Checks authority can see admin area pages.void
checkCanAddToRemoveFromGroup(SUserGroup group)
void
checkCanAdministerAgent(SBuildAgent agent)
void
checkCanChangeUserOrGroupRole(RoleScope scope, Role role)
void
checkCanCopyProject(SProject originalProject, SProject parentOfCopy)
void
checkCanCreateBuildPromotion()
void
checkCanCreateRemoveVcsRoot(SProject project)
void
checkCanDeleteUser(SUser user)
void
checkCanDeleteUserGroup(SUserGroup group)
void
checkCanEditBuildType(SBuildType buildType)
void
checkCanEditFeatureOfType(SProject project, String featureType)
void
checkCanEditNotification(NotificationRulesHolder notificationRulesHolder, Collection<String> projectIds)
void
checkCanEditNotifications(NotificationRulesHolder notificationRulesHolder)
void
checkCanEditProject(SProject project)
void
checkCanEditTemplate(BuildTypeTemplate template)
void
checkCanEditUser(SUser user)
void
checkCanEditUserGroup(SUserGroup userGroup)
void
checkCanEditVcsModification(SVcsModification vcsModification)
void
checkCanEditVcsRoot(SVcsRoot vcsRoot)
void
checkCanEditVcsUsername(SUser user, String projectId)
void
checkCanManagePoolProjectAssociations(Set<String> projectIds)
Checks authority can manage agent pools the given projects are associated withvoid
checkCanManageRolesInScope(RoleScope scope)
void
checkCanRemoveBuild(SBuild build)
void
checkCanRemoveProject(SProject project)
void
checkCanRunBuildOnAgent(BuildType buildType, BuildAgent agent)
void
checkCanRunBuildWithCustomPatch(BuildType buildType)
void
checkCanStopBuild(SQueuedBuild queuedBuild)
void
checkCanStopBuild(SRunningBuild build)
void
checkCanViewAgent(SBuildAgent agent)
void
checkCanViewAgentDetailsInPool(AgentPool agentPool)
void
checkCanViewAgentPool(AgentPool agentPool)
void
checkCanViewAgentTypeDetails(SAgentType agentType)
void
checkCanViewBuild(Build build)
void
checkCanViewFileContent(String projectId)
void
checkCanViewFileContent(SVcsModification mod)
void
checkCanViewProject(String projectId)
void
checkCanViewSettings(SBuildType buildType)
void
checkCanViewSettings(SProject project)
void
checkCanViewUser(SUser user)
void
checkCanViewUserProfile(SUser user)
void
checkCanViewVcsModification(SVcsModification vcsModification)
void
checkCanViewVcsRoot(SVcsRoot vcsRoot)
void
checkHasAnyPermissionForProject(String projectId, Permission... permissions)
Checks authority has at least one of the specified permissions in the project.void
checkHasGlobalPermission(Permission... permissions)
Checks authority has all the specified permissions assigned globally.void
checkHasPermissionForAnyProject(Permission permission)
Checks authority has the specified permission in at least one project.void
checkHasPermissionForAnyProjectOrGlobal(Permission projectPermission, Permission globalPermission)
Checks authority has the project-associated permission in at least one project or the global permission.void
checkHasPermissionForPool(AgentPool pool, Permission globalPermission, Permission poolPermission)
Checks authority has either the project-level permission in all projects associated with the pool or the global permission.void
checkHasPermissionForProjectOrGlobal(String projectId, Permission projectPermission, Permission globalPermission)
Checks authority has either the project-associated permission in the project or the global permission.void
checkHasPermissionsForProject(String projectId, Permission... permissions)
Checks authority has all specified permissions in the project.
-
-
-
Method Detail
-
checkHasGlobalPermission
void checkHasGlobalPermission(@NotNull Permission... permissions) throws AccessDeniedException
Checks authority has all the specified permissions assigned globally.- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkHasPermissionForAnyProject
void checkHasPermissionForAnyProject(@NotNull Permission permission) throws AccessDeniedException
Checks authority has the specified permission in at least one project.- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkHasAnyPermissionForProject
void checkHasAnyPermissionForProject(@NotNull String projectId, @NotNull Permission... permissions) throws AccessDeniedException
Checks authority has at least one of the specified permissions in the project.- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkHasPermissionsForProject
void checkHasPermissionsForProject(@NotNull String projectId, @NotNull Permission... permissions) throws AccessDeniedException
Checks authority has all specified permissions in the project.- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkHasPermissionForProjectOrGlobal
void checkHasPermissionForProjectOrGlobal(@NotNull String projectId, @NotNull Permission projectPermission, @NotNull Permission globalPermission) throws AccessDeniedException
Checks authority has either the project-associated permission in the project or the global permission.- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkHasPermissionForAnyProjectOrGlobal
void checkHasPermissionForAnyProjectOrGlobal(@NotNull Permission projectPermission, @NotNull Permission globalPermission) throws AccessDeniedException
Checks authority has the project-associated permission in at least one project or the global permission.- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkAdminSpaceAvailable
void checkAdminSpaceAvailable()
Checks authority can see admin area pages.- Since:
- 2018.2
-
checkCanViewProject
void checkCanViewProject(@NotNull String projectId) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditProject
void checkCanEditProject(@NotNull SProject project) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanRemoveProject
void checkCanRemoveProject(@NotNull SProject project) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditVcsRoot
void checkCanEditVcsRoot(@NotNull SVcsRoot vcsRoot) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditTemplate
void checkCanEditTemplate(@NotNull BuildTypeTemplate template) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditBuildType
void checkCanEditBuildType(@NotNull SBuildType buildType) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewVcsRoot
void checkCanViewVcsRoot(@NotNull SVcsRoot vcsRoot) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanCreateRemoveVcsRoot
void checkCanCreateRemoveVcsRoot(@NotNull SProject project) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditFeatureOfType
void checkCanEditFeatureOfType(@NotNull SProject project, @NotNull String featureType) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanCopyProject
void checkCanCopyProject(@NotNull SProject originalProject, @NotNull SProject parentOfCopy) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewSettings
void checkCanViewSettings(@NotNull SProject project) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewSettings
void checkCanViewSettings(@NotNull SBuildType buildType) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewBuild
void checkCanViewBuild(@NotNull Build build) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanCreateBuildPromotion
void checkCanCreateBuildPromotion() throws AccessDeniedException
- Throws:
AccessDeniedException
- if current node cannot create promotions- Since:
- 2019.1
-
checkCanRunBuildOnAgent
void checkCanRunBuildOnAgent(@NotNull BuildType buildType, @Nullable BuildAgent agent) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanRunBuildWithCustomPatch
void checkCanRunBuildWithCustomPatch(@NotNull BuildType buildType) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2021.1
-
checkCanStopBuild
void checkCanStopBuild(@NotNull SRunningBuild build) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanStopBuild
void checkCanStopBuild(@NotNull SQueuedBuild queuedBuild) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanRemoveBuild
void checkCanRemoveBuild(@NotNull SBuild build) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkHasPermissionForPool
void checkHasPermissionForPool(@NotNull AgentPool pool, @NotNull Permission globalPermission, @NotNull Permission poolPermission) throws AccessDeniedException
Checks authority has either the project-level permission in all projects associated with the pool or the global permission.- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanManagePoolProjectAssociations
void checkCanManagePoolProjectAssociations(@NotNull Set<String> projectIds) throws AccessDeniedException
Checks authority can manage agent pools the given projects are associated with- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanAdministerAgent
void checkCanAdministerAgent(@NotNull SBuildAgent agent) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewAgent
void checkCanViewAgent(@NotNull SBuildAgent agent) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewAgentPool
void checkCanViewAgentPool(@NotNull AgentPool agentPool) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewAgentDetailsInPool
void checkCanViewAgentDetailsInPool(@NotNull AgentPool agentPool) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewAgentTypeDetails
void checkCanViewAgentTypeDetails(@NotNull SAgentType agentType) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewUser
void checkCanViewUser(@NotNull SUser user) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewUserProfile
void checkCanViewUserProfile(@NotNull SUser user) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditUser
void checkCanEditUser(@NotNull SUser user) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditVcsUsername
void checkCanEditVcsUsername(@NotNull SUser user, String projectId)
- Since:
- 2022.2
-
checkCanDeleteUser
void checkCanDeleteUser(@NotNull SUser user) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2020.2.1
-
checkCanChangeUserOrGroupRole
void checkCanChangeUserOrGroupRole(@NotNull RoleScope scope, @NotNull Role role) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanManageRolesInScope
void checkCanManageRolesInScope(@NotNull RoleScope scope) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanAddToRemoveFromGroup
void checkCanAddToRemoveFromGroup(@NotNull SUserGroup group) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditNotifications
void checkCanEditNotifications(@NotNull NotificationRulesHolder notificationRulesHolder) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditNotification
void checkCanEditNotification(@NotNull NotificationRulesHolder notificationRulesHolder, @NotNull Collection<String> projectIds) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2019.2
-
checkCanViewFileContent
void checkCanViewFileContent(@NotNull String projectId) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewFileContent
void checkCanViewFileContent(@NotNull SVcsModification mod) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditVcsModification
void checkCanEditVcsModification(@NotNull SVcsModification vcsModification) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanViewVcsModification
void checkCanViewVcsModification(@NotNull SVcsModification vcsModification) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanEditUserGroup
void checkCanEditUserGroup(@NotNull SUserGroup userGroup) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
checkCanDeleteUserGroup
void checkCanDeleteUserGroup(@NotNull SUserGroup group) throws AccessDeniedException
- Throws:
AccessDeniedException
- Since:
- 2018.2
-
-