Class ServerAuthUtil
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.auth.ServerAuthUtil
-
public class ServerAuthUtil extends Object
- Author:
- Sergey.Anchipolevsky Date: 24.09.2007
-
-
Field Summary
Fields Modifier and Type Field Description static StringINACCESSIBLE_AGENT_NAMEstatic StringTEAMCITY_USERS_PER_PROJECT_USER_ACCESS_ENABLEDstatic StringVERSIONED_SETTINGS_FEATURE_TYPE
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleancanAddToRemoveFromGroup(AuthorityHolder authority, SUserGroup group)static booleancanChangeUserOrGroupRole(AuthorityHolder authorityHolder, RoleScope scope, Role role)static booleancanDeleteUser(AuthorityHolder authorityHolder, SUser editee)static booleancanDeleteUserGroup(AuthorityHolder authorityHolder, SUserGroup userGroup)static booleancanEditFeatureOfType(AuthorityHolder authorityHolder, SProject project, String featureType)static booleancanEditFeaturesOfTypes(AuthorityHolder authorityHolder, SProject project, String... featureTypes)static booleancanEditNotifications(AuthorityHolder authorityHolder, NotificationRulesHolder editee)Checks that authorityHolder can edit any notification rule of editee - either editee==authorityHolder and can modify own profile either authorityHolder has global permission to edit notificationsstatic booleancanEditNotifications(AuthorityHolder authorityHolder, NotificationRulesHolder editee, SProject project)static booleancanEditUser(AuthorityHolder authorityHolder, SUser editee)static booleancanEditUserGroup(AuthorityHolder authorityHolder, UserGroup userGroup)static booleancanEditUserGroupNotificationRules(AuthorityHolder authorityHolder)static booleancanEditUserGroupRoles(AuthorityHolder authorityHolder, UserGroupEx userGroupEx)static booleancanEditVcsUsername(AuthorityHolder authorityHolder, SUser user, String projectId)static booleancanEditVcsUsernameInAtLeastOneProject(AuthorityHolder authorityHolder, SUser editee)static booleancanViewUser(AuthorityHolder authorityHolder, SUser user)static booleancanViewUserGroup(AuthorityHolder authorityHolder, UserGroup userGroup)static voidcheckCanAddToRemoveFromGroup(AuthorityHolder authority, SUserGroup group)Deprecated.static voidcheckCanChangeUserOrGroupRole(AuthorityHolder authorityHolder, RoleScope scope, Role role)Deprecated.static voidcheckCanCopyProject(AuthorityHolder authHolder, SProject originalProject, SProject parentOfCopy)Deprecated.static voidcheckCanCreateRemoveVcsRoot(AuthorityHolder authHolder, SProject project)Deprecated.static voidcheckCanDeleteUserGroup(AuthorityHolder authorityHolder, SUserGroup userGroup)Deprecated.static voidcheckCanEditBuildType(AuthorityHolder authHolder, SBuildType buildType)Deprecated.static voidcheckCanEditFeatureOfType(AuthorityHolder authorityHolder, SProject project, String featureType)Deprecated.static voidcheckCanEditNotifications(AuthorityHolder authorityHolder, NotificationRulesHolder editee)Deprecated.static voidcheckCanEditProject(AuthorityHolder authHolder, SProject project)Deprecated.static voidcheckCanEditTemplate(AuthorityHolder authHolder, BuildTypeTemplate template)Deprecated.static voidcheckCanEditUser(AuthorityHolder authorityHolder, SUser editee)Deprecated.static voidcheckCanEditUserGroup(AuthorityHolder authorityHolder, SUserGroup userGroup)Deprecated.static voidcheckCanEditVcsRoot(AuthorityHolder authHolder, SVcsRoot vcsRoot)Deprecated.static voidcheckCanEditVcsUsernameInAtLeastOneProject(AuthorityHolder authorityHolder, SUser editee)static voidcheckCanManagePoolProjectAssociations(AuthorityHolder authHolder, Collection<String> poolProjects)Deprecated.static voidcheckCanManageRolesInScope(AuthorityHolder authorityHolder, RoleScope scope)Deprecated.static voidcheckCanRemoveBuild(AuthorityHolder authorityHolder, SBuild build)Deprecated.static voidcheckCanRemoveProject(AuthorityHolder authorityHolder, SProject project)Deprecated.static voidcheckCanRunBuildOnAgent(AuthorityHolder authorityHolder, BuildType buildType, BuildAgent agent)Deprecated.static voidcheckCanStopBuild(AuthorityHolder authorityHolder, SRunningBuild build)Deprecated.static voidcheckCanViewAgentDetailsInPool(AuthorityHolder authorityHolder, AgentPool agentPool)Deprecated.static voidcheckCanViewAgentPool(AuthorityHolder authorityHolder, AgentPool agentPool)Deprecated.static voidcheckCanViewSettings(AuthorityHolder authorityHolder, BuildTypeTemplate template)Deprecated.static voidcheckCanViewSettings(AuthorityHolder authorityHolder, SBuildType buildType)Deprecated.static voidcheckCanViewSettings(AuthorityHolder authorityHolder, SVcsRoot vcsRoot)Deprecated.static voidcheckCanViewUserProfile(AuthorityHolder authorityHolder, SUser user)Deprecated.static voidcheckFileContentAccessible(AuthorityHolder authorityHolder, String projectId)Deprecated.static voidcheckFileContentAccessible(AuthorityHolder authorityHolder, SVcsModification mod)Deprecated.static voidcheckHasGlobalPermission(AuthorityHolder authorityHolder, Permission permission)Deprecated.static voidcheckHasPermissionForAnyProject(AuthorityHolder authorityHolder, Permission permission)Deprecated.static voidcheckHasPermissionForPool(AuthorityHolder authorityHolder, AgentPool pool, Permission globalPermission, Permission poolPermission)Deprecated.static voidcheckHasPermissionForProject(AuthorityHolder authorityHolder, String projectId, Permission permission)Deprecated.static voidcheckReadAccessTo(AuthorityHolder authorityHolder, String projectId)Deprecated.static voidcheckReadAccessTo(AuthorityHolder authorityHolder, Build build)Deprecated.static voidcheckReadAccessTo(AuthorityHolder authorityHolder, BuildTypeDescriptor buildType)Deprecated.static voidcheckReadAccessTo(AuthorityHolder authorityHolder, SVcsModification vcsModification)Deprecated.static voidcheckReadAccessTo(AuthorityHolder authorityHolder, SVcsRoot vcsRoot)Deprecated.static voidcheckReadAccessTo(AuthorityHolder authorityHolder, VcsRootInstance vcsRoot)Deprecated.static booleancontainsAllPermissionsOf(AuthorityHolder bigHolder, AuthorityHolder smallHolder)static List<SVcsModification>filterModifications(List<SVcsModification> unfiltered, SecurityContextEx securityContext)static LonggetBuildIdIfBuildAuthority(AuthorityHolder authorityHolder)static booleanhasPermissionToEditNotificationRule(AuthorityHolder authorityHolder, NotificationRulesHolder notificationRulesHolder, Collection<String> affectedProjectIds)static booleanhasPermissionToEditNotificationRule(AuthorityHolder authorityHolder, NotificationRulesHolder notificationRulesHolder, NotificationRule notificationRule, Function<Collection<String>,Collection<String>> buildTypeIdsToParentProjectsMapper)static booleanisUserAndGroupFilteringEnabled()
-
-
-
Field Detail
-
INACCESSIBLE_AGENT_NAME
public static final String INACCESSIBLE_AGENT_NAME
- See Also:
- Constant Field Values
-
VERSIONED_SETTINGS_FEATURE_TYPE
public static final String VERSIONED_SETTINGS_FEATURE_TYPE
- See Also:
- Constant Field Values
-
TEAMCITY_USERS_PER_PROJECT_USER_ACCESS_ENABLED
public static final String TEAMCITY_USERS_PER_PROJECT_USER_ACCESS_ENABLED
- See Also:
- Constant Field Values
-
-
Method Detail
-
checkReadAccessTo
@Deprecated public static void checkReadAccessTo(@NotNull AuthorityHolder authorityHolder, @NotNull String projectId)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkReadAccessTo
@Deprecated public static void checkReadAccessTo(@NotNull AuthorityHolder authorityHolder, @NotNull BuildTypeDescriptor buildType)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkReadAccessTo
@Deprecated public static void checkReadAccessTo(@NotNull AuthorityHolder authorityHolder, @NotNull Build build)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkReadAccessTo
@Deprecated public static void checkReadAccessTo(@NotNull AuthorityHolder authorityHolder, @NotNull VcsRootInstance vcsRoot)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkReadAccessTo
@Deprecated public static void checkReadAccessTo(@NotNull AuthorityHolder authorityHolder, @NotNull SVcsRoot vcsRoot)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkReadAccessTo
@Deprecated public static void checkReadAccessTo(@NotNull AuthorityHolder authorityHolder, @NotNull SVcsModification vcsModification)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkHasGlobalPermission
@Deprecated public static void checkHasGlobalPermission(@NotNull AuthorityHolder authorityHolder, @NotNull Permission permission)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanRemoveProject
@Deprecated public static void checkCanRemoveProject(@NotNull AuthorityHolder authorityHolder, @NotNull SProject project)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkHasPermissionForProject
@Deprecated public static void checkHasPermissionForProject(@NotNull AuthorityHolder authorityHolder, @NotNull String projectId, @NotNull Permission permission)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkHasPermissionForPool
@Deprecated public static void checkHasPermissionForPool(@NotNull AuthorityHolder authorityHolder, @NotNull AgentPool pool, @NotNull Permission globalPermission, @NotNull Permission poolPermission)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanViewAgentPool
@Deprecated public static void checkCanViewAgentPool(@NotNull AuthorityHolder authorityHolder, @NotNull AgentPool agentPool)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanViewAgentDetailsInPool
@Deprecated public static void checkCanViewAgentDetailsInPool(@NotNull AuthorityHolder authorityHolder, @NotNull AgentPool agentPool)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanRunBuildOnAgent
@Deprecated public static void checkCanRunBuildOnAgent(@NotNull AuthorityHolder authorityHolder, @NotNull BuildType buildType, @Nullable BuildAgent agent)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanStopBuild
@Deprecated public static void checkCanStopBuild(@NotNull AuthorityHolder authorityHolder, @NotNull SRunningBuild build)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
getBuildIdIfBuildAuthority
@Nullable public static Long getBuildIdIfBuildAuthority(@NotNull AuthorityHolder authorityHolder)
-
checkCanRemoveBuild
@Deprecated public static void checkCanRemoveBuild(@NotNull AuthorityHolder authorityHolder, @NotNull SBuild build)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkHasPermissionForAnyProject
@Deprecated public static void checkHasPermissionForAnyProject(@NotNull AuthorityHolder authorityHolder, @NotNull Permission permission)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanChangeUserOrGroupRole
@Deprecated public static void checkCanChangeUserOrGroupRole(@NotNull AuthorityHolder authorityHolder, @NotNull RoleScope scope, @NotNull Role role)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanEditUser
@Deprecated public static void checkCanEditUser(@NotNull AuthorityHolder authorityHolder, @NotNull SUser editee)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanEditVcsUsernameInAtLeastOneProject
public static void checkCanEditVcsUsernameInAtLeastOneProject(@NotNull AuthorityHolder authorityHolder, @NotNull SUser editee)
-
canEditVcsUsernameInAtLeastOneProject
public static boolean canEditVcsUsernameInAtLeastOneProject(AuthorityHolder authorityHolder, SUser editee)
-
canEditVcsUsername
public static boolean canEditVcsUsername(AuthorityHolder authorityHolder, SUser user, String projectId)
-
canDeleteUser
public static boolean canDeleteUser(@NotNull AuthorityHolder authorityHolder, @NotNull SUser editee)- Since:
- 2020.2.1 - use
AccessCheckerfor the security asserts
-
canEditUser
public static boolean canEditUser(@NotNull AuthorityHolder authorityHolder, @NotNull SUser editee)
-
checkCanViewUserProfile
@Deprecated public static void checkCanViewUserProfile(@NotNull AuthorityHolder authorityHolder, @NotNull SUser user)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanManageRolesInScope
@Deprecated public static void checkCanManageRolesInScope(@NotNull AuthorityHolder authorityHolder, @NotNull RoleScope scope)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
canChangeUserOrGroupRole
public static boolean canChangeUserOrGroupRole(@NotNull AuthorityHolder authorityHolder, @NotNull RoleScope scope, @NotNull Role role)
-
checkFileContentAccessible
@Deprecated public static void checkFileContentAccessible(@NotNull AuthorityHolder authorityHolder, @NotNull String projectId)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkFileContentAccessible
@Deprecated public static void checkFileContentAccessible(AuthorityHolder authorityHolder, SVcsModification mod)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanEditNotifications
@Deprecated public static void checkCanEditNotifications(AuthorityHolder authorityHolder, NotificationRulesHolder editee)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanEditFeatureOfType
@Deprecated public static void checkCanEditFeatureOfType(@NotNull AuthorityHolder authorityHolder, @NotNull SProject project, @NotNull String featureType)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
canEditNotifications
public static boolean canEditNotifications(@NotNull AuthorityHolder authorityHolder, @NotNull NotificationRulesHolder editee)Checks that authorityHolder can edit any notification rule of editee - either editee==authorityHolder and can modify own profile either authorityHolder has global permission to edit notifications- Parameters:
authorityHolder-editee-- Returns:
-
canEditNotifications
public static boolean canEditNotifications(@NotNull AuthorityHolder authorityHolder, @NotNull NotificationRulesHolder editee, @NotNull SProject project)
-
hasPermissionToEditNotificationRule
public static boolean hasPermissionToEditNotificationRule(@NotNull AuthorityHolder authorityHolder, @NotNull NotificationRulesHolder notificationRulesHolder, @NotNull Collection<String> affectedProjectIds)
-
hasPermissionToEditNotificationRule
public static boolean hasPermissionToEditNotificationRule(@NotNull AuthorityHolder authorityHolder, @NotNull NotificationRulesHolder notificationRulesHolder, @NotNull NotificationRule notificationRule, @NotNull Function<Collection<String>,Collection<String>> buildTypeIdsToParentProjectsMapper)
-
checkCanAddToRemoveFromGroup
@Deprecated public static void checkCanAddToRemoveFromGroup(@NotNull AuthorityHolder authority, @NotNull SUserGroup group)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
canAddToRemoveFromGroup
public static boolean canAddToRemoveFromGroup(@NotNull AuthorityHolder authority, @NotNull SUserGroup group)
-
containsAllPermissionsOf
public static boolean containsAllPermissionsOf(@NotNull AuthorityHolder bigHolder, @NotNull AuthorityHolder smallHolder)
-
checkCanEditVcsRoot
@Deprecated public static void checkCanEditVcsRoot(@NotNull AuthorityHolder authHolder, @NotNull SVcsRoot vcsRoot)
Deprecated.Checks whether specified authority holder can update VCS root- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanEditTemplate
@Deprecated public static void checkCanEditTemplate(@NotNull AuthorityHolder authHolder, @NotNull BuildTypeTemplate template)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanEditBuildType
@Deprecated public static void checkCanEditBuildType(@NotNull AuthorityHolder authHolder, @NotNull SBuildType buildType)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanEditProject
@Deprecated public static void checkCanEditProject(@NotNull AuthorityHolder authHolder, @NotNull SProject project)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanCreateRemoveVcsRoot
@Deprecated public static void checkCanCreateRemoveVcsRoot(@NotNull AuthorityHolder authHolder, @NotNull SProject project)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanCopyProject
@Deprecated public static void checkCanCopyProject(@NotNull AuthorityHolder authHolder, @NotNull SProject originalProject, @NotNull SProject parentOfCopy)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanViewSettings
@Deprecated public static void checkCanViewSettings(@NotNull AuthorityHolder authorityHolder, @NotNull SBuildType buildType)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanViewSettings
@Deprecated public static void checkCanViewSettings(@NotNull AuthorityHolder authorityHolder, @NotNull BuildTypeTemplate template)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanViewSettings
@Deprecated public static void checkCanViewSettings(@NotNull AuthorityHolder authorityHolder, @NotNull SVcsRoot vcsRoot)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
checkCanManagePoolProjectAssociations
@Deprecated public static void checkCanManagePoolProjectAssociations(@NotNull AuthorityHolder authHolder, @NotNull Collection<String> poolProjects)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
filterModifications
@NotNull public static List<SVcsModification> filterModifications(@NotNull List<SVcsModification> unfiltered, SecurityContextEx securityContext)
-
isUserAndGroupFilteringEnabled
public static boolean isUserAndGroupFilteringEnabled()
-
canViewUserGroup
public static boolean canViewUserGroup(@NotNull AuthorityHolder authorityHolder, @NotNull UserGroup userGroup)
-
canEditUserGroupNotificationRules
public static boolean canEditUserGroupNotificationRules(@NotNull AuthorityHolder authorityHolder)
-
canEditUserGroup
public static boolean canEditUserGroup(@NotNull AuthorityHolder authorityHolder, @NotNull UserGroup userGroup)
-
canEditUserGroupRoles
public static boolean canEditUserGroupRoles(@NotNull AuthorityHolder authorityHolder, UserGroupEx userGroupEx)
-
checkCanEditUserGroup
@Deprecated public static void checkCanEditUserGroup(@NotNull AuthorityHolder authorityHolder, @NotNull SUserGroup userGroup)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
canDeleteUserGroup
public static boolean canDeleteUserGroup(@NotNull AuthorityHolder authorityHolder, @NotNull SUserGroup userGroup)
-
checkCanDeleteUserGroup
@Deprecated public static void checkCanDeleteUserGroup(AuthorityHolder authorityHolder, SUserGroup userGroup)
Deprecated.- Since:
- 2018.1.2 - use
AccessCheckerfor the security asserts
-
canViewUser
public static boolean canViewUser(@NotNull AuthorityHolder authorityHolder, @NotNull SUser user)
-
canEditFeaturesOfTypes
public static boolean canEditFeaturesOfTypes(@NotNull AuthorityHolder authorityHolder, @NotNull SProject project, @NotNull String... featureTypes)
-
canEditFeatureOfType
public static boolean canEditFeatureOfType(@NotNull AuthorityHolder authorityHolder, @NotNull SProject project, @NotNull String featureType)
-
-