Interface AccessChecker
-
- All Known Implementing Classes:
ServerAccessChecker
public interface AccessCheckerThis 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 throwsMissingServerResponsibilityExceptionif not - checks whether current authority can perform the action and throwsAccessDeniedExceptionif 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 voidcheckAdminSpaceAvailable()Checks authority can see admin area pages.voidcheckCanAddToRemoveFromGroup(SUserGroup group)voidcheckCanAdministerAgent(SBuildAgent agent)voidcheckCanChangeUserOrGroupRole(RoleScope scope, Role role)voidcheckCanCopyProject(SProject originalProject, SProject parentOfCopy)voidcheckCanCreateBuildPromotion()voidcheckCanCreateRemoveVcsRoot(SProject project)voidcheckCanDeleteUser(SUser user)voidcheckCanDeleteUserGroup(SUserGroup group)voidcheckCanEditBuildType(SBuildType buildType)voidcheckCanEditFeatureOfType(SProject project, String featureType)voidcheckCanEditNotification(NotificationRulesHolder notificationRulesHolder, Collection<String> projectIds)voidcheckCanEditNotifications(NotificationRulesHolder notificationRulesHolder)voidcheckCanEditProject(SProject project)voidcheckCanEditTemplate(BuildTypeTemplate template)voidcheckCanEditUser(SUser user)voidcheckCanEditUserGroup(SUserGroup userGroup)voidcheckCanEditVcsModification(SVcsModification vcsModification)voidcheckCanEditVcsRoot(SVcsRoot vcsRoot)voidcheckCanEditVcsUsername(SUser user, String projectId)voidcheckCanManagePoolProjectAssociations(Set<String> projectIds)Checks authority can manage agent pools the given projects are associated withvoidcheckCanManageRolesInScope(RoleScope scope)voidcheckCanRemoveBuild(SBuild build)voidcheckCanRemoveProject(SProject project)voidcheckCanRunBuildOnAgent(BuildType buildType, BuildAgent agent)voidcheckCanRunBuildWithCustomPatch(BuildType buildType)voidcheckCanStopBuild(SQueuedBuild queuedBuild)voidcheckCanStopBuild(SRunningBuild build)voidcheckCanViewAgent(SBuildAgent agent)voidcheckCanViewAgentDetailsInPool(AgentPool agentPool)voidcheckCanViewAgentPool(AgentPool agentPool)voidcheckCanViewAgentTypeDetails(SAgentType agentType)voidcheckCanViewBuild(Build build)voidcheckCanViewFileContent(String projectId)voidcheckCanViewFileContent(SVcsModification mod)voidcheckCanViewProject(String projectId)voidcheckCanViewSettings(SBuildType buildType)voidcheckCanViewSettings(SProject project)voidcheckCanViewUser(SUser user)voidcheckCanViewUserProfile(SUser user)voidcheckCanViewVcsModification(SVcsModification vcsModification)voidcheckCanViewVcsRoot(SVcsRoot vcsRoot)voidcheckHasAnyPermissionForProject(String projectId, Permission... permissions)Checks authority has at least one of the specified permissions in the project.voidcheckHasGlobalPermission(Permission... permissions)Checks authority has all the specified permissions assigned globally.voidcheckHasPermissionForAnyProject(Permission permission)Checks authority has the specified permission in at least one project.voidcheckHasPermissionForAnyProjectOrGlobal(Permission projectPermission, Permission globalPermission)Checks authority has the project-associated permission in at least one project or the global permission.voidcheckHasPermissionForPool(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.voidcheckHasPermissionForProjectOrGlobal(String projectId, Permission projectPermission, Permission globalPermission)Checks authority has either the project-associated permission in the project or the global permission.voidcheckHasPermissionsForProject(String projectId, Permission... permissions)Checks authority has all specified permissions in the project.
-
-
-
Method Detail
-
checkHasGlobalPermission
void checkHasGlobalPermission(@NotNull Permission... permissions) throws AccessDeniedExceptionChecks authority has all the specified permissions assigned globally.- Throws:
AccessDeniedException- Since:
- 2018.2
-
checkHasPermissionForAnyProject
void checkHasPermissionForAnyProject(@NotNull Permission permission) throws AccessDeniedExceptionChecks 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 AccessDeniedExceptionChecks 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 AccessDeniedExceptionChecks 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 AccessDeniedExceptionChecks 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 AccessDeniedExceptionChecks 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 AccessDeniedExceptionChecks 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 AccessDeniedExceptionChecks 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
-
-