Interface AuthorityHolder
-
- All Known Subinterfaces:
BuildAuthorityHolder,PresignedTokenAuthorityHolder,SUser,SUserGroup,User,UserEx,UserGroupEx
- All Known Implementing Classes:
AllUsersGroup,AssociatedUser,BaseUser,BuildAuthorityHolderImpl,InMemoryUser,MockAuthorityHolder,OrganizationProjectAwareBuildAuthorityHolder,PermissionsBasedAuthorityHolder,PresignedTokenAuthorityHolderImpl,RestrictedUserImpl,SecuredUser,SecuredUserGroup,SimpleUserData,TestUser,UserData,UserGroupImpl,UserImpl
public interface AuthorityHolderAuthority holder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Pair<Permissions,Map<String,Permissions>>getAllPermissions()Returns both global and project permissions at once.UsergetAssociatedUser()Returns the user object associated with the principal.PermissionsgetGlobalPermissions()Returns all granted non-project related permissions and all project-related permissions granted globallyPermissionsgetPermissionsGrantedForAllProjects(Collection<String> projectIds)Returns all permissions granted for all projects from the collection.PermissionsgetPermissionsGrantedForAnyOfProjects(Collection<String> projectIds)Returns union of permissions granted for projects from the collection.PermissionsgetPermissionsGrantedForProject(String projectId)Returns all permissions granted for particular project.Map<String,Permissions>getProjectsPermissions()Returns map of project-related permissions that were granted for a particular project.booleanhasAllPermissionsOf(AuthorityHolder authorityHolder)Returns true if this authority holder has all permissions of another authority holder.booleanisPermissionGrantedForAllProjects(Collection<String> projectIds, Permission permission)Returns true if permission is granted for all projects from the given list.booleanisPermissionGrantedForAnyOfProjects(Collection<String> projectIds, Permission permission)Returns true if specified permission is granted for at least one project from the given collectionbooleanisPermissionGrantedForAnyProject(Permission permission)Returns true if specified permission is granted for at least one projectbooleanisPermissionGrantedForProject(String projectId, Permission permission)Returns true if permission is granted for a project, i.e.booleanisPermissionGrantedGlobally(Permission permission)Returns true if specified permission granted globally (i.e.
-
-
-
Method Detail
-
isPermissionGrantedGlobally
boolean isPermissionGrantedGlobally(@NotNull Permission permission)Returns true if specified permission granted globally (i.e. not associated with any particular object)- Parameters:
permission- permission to check- Returns:
- true or false
-
getGlobalPermissions
@NotNull Permissions getGlobalPermissions()
Returns all granted non-project related permissions and all project-related permissions granted globally- Returns:
- see above
-
getProjectsPermissions
@NotNull Map<String,Permissions> getProjectsPermissions()
Returns map of project-related permissions that were granted for a particular project. Project internal id is used as the key.- Returns:
- map of project permissions
-
getAllPermissions
@NotNull default Pair<Permissions,Map<String,Permissions>> getAllPermissions()
Returns both global and project permissions at once.- Returns:
- a pair of global and project permissions.
- Since:
- 2022.10
-
isPermissionGrantedForProject
boolean isPermissionGrantedForProject(@NotNull String projectId, @NotNull Permission permission)Returns true if permission is granted for a project, i.e. the result is true if there is a project related permission granted globally or for specified project- Parameters:
projectId- project internal idpermission- permission to check- Returns:
- see above
-
isPermissionGrantedForAllProjects
boolean isPermissionGrantedForAllProjects(@NotNull Collection<String> projectIds, @NotNull Permission permission)Returns true if permission is granted for all projects from the given list. Returns false if projectIds is empty.- Parameters:
projectIds- collection of project idspermission- permission to check @return see above- See Also:
isPermissionGrantedForProject(java.lang.String, jetbrains.buildServer.serverSide.auth.Permission)
-
isPermissionGrantedForAnyProject
boolean isPermissionGrantedForAnyProject(@NotNull Permission permission)Returns true if specified permission is granted for at least one project- Parameters:
permission- permission to check- Returns:
- see above
-
isPermissionGrantedForAnyOfProjects
boolean isPermissionGrantedForAnyOfProjects(@NotNull Collection<String> projectIds, @NotNull Permission permission)Returns true if specified permission is granted for at least one project from the given collection- Parameters:
permission- permission to check- Returns:
- see above
-
getPermissionsGrantedForProject
@NotNull Permissions getPermissionsGrantedForProject(@NotNull String projectId)
Returns all permissions granted for particular project. These include permissions granted specifically for the specified project and granted global project-related permissions (i.e. permissions supporting project associationPermission.isProjectAssociationSupported()).- Parameters:
projectId- project internal id- Returns:
- all granted permissions for particular project
-
getPermissionsGrantedForAllProjects
@NotNull Permissions getPermissionsGrantedForAllProjects(@NotNull Collection<String> projectIds)
Returns all permissions granted for all projects from the collection. These include permissions granted specifically for the specified projects and granted global project-related permissions (i.e. permissions supporting project associationPermission.isProjectAssociationSupported()).- Parameters:
projectIds- collection of project internal ids- Returns:
- all granted permissions for all projects
-
getPermissionsGrantedForAnyOfProjects
@NotNull Permissions getPermissionsGrantedForAnyOfProjects(@NotNull Collection<String> projectIds)
Returns union of permissions granted for projects from the collection. These include permissions granted specifically for the specified projects and granted global project-related permissions (i.e. permissions supporting project associationPermission.isProjectAssociationSupported()).- Parameters:
projectIds- collection of project internal ids- Returns:
- all granted permissions for all projects
- Since:
- 2017.2
-
getAssociatedUser
@Nullable User getAssociatedUser()
Returns the user object associated with the principal.- Returns:
- may be null if the authority holder is not a user.
-
hasAllPermissionsOf
boolean hasAllPermissionsOf(@NotNull AuthorityHolder authorityHolder)Returns true if this authority holder has all permissions of another authority holder.- Parameters:
authorityHolder-- Returns:
- see above
- Since:
- 2022.10
-
-