Interface AuthorityHolder
-
- All Known Subinterfaces:
SUser
,SUserGroup
,User
- All Known Implementing Classes:
SimpleUserData
,UserData
public interface AuthorityHolder
Authority holder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default com.intellij.openapi.util.Pair<Permissions,java.util.Map<java.lang.String,Permissions>>
getAllPermissions()
Returns both global and project permissions at once.User
getAssociatedUser()
Returns the user object associated with the principal.Permissions
getGlobalPermissions()
Returns all granted non-project related permissions and all project-related permissions granted globallyPermissions
getPermissionsGrantedForAllProjects(java.util.Collection<java.lang.String> projectIds)
Returns all permissions granted for all projects from the collection.Permissions
getPermissionsGrantedForAnyOfProjects(java.util.Collection<java.lang.String> projectIds)
Returns union of permissions granted for projects from the collection.Permissions
getPermissionsGrantedForProject(java.lang.String projectId)
Returns all permissions granted for particular project.java.util.Map<java.lang.String,Permissions>
getProjectsPermissions()
Returns map of project-related permissions that were granted for a particular project.boolean
hasAllPermissionsOf(AuthorityHolder authorityHolder)
Returns true if this authority holder has all permissions of another authority holder.boolean
isPermissionGrantedForAllProjects(java.util.Collection<java.lang.String> projectIds, Permission permission)
Returns true if permission is granted for all projects from the given list.boolean
isPermissionGrantedForAnyOfProjects(java.util.Collection<java.lang.String> projectIds, Permission permission)
Returns true if specified permission is granted for at least one project from the given collectionboolean
isPermissionGrantedForAnyProject(Permission permission)
Returns true if specified permission is granted for at least one projectboolean
isPermissionGrantedForProject(java.lang.String projectId, Permission permission)
Returns true if permission is granted for a project, i.e.boolean
isPermissionGrantedGlobally(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 java.util.Map<java.lang.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 com.intellij.openapi.util.Pair<Permissions,java.util.Map<java.lang.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 java.lang.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 java.util.Collection<java.lang.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 java.util.Collection<java.lang.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 java.lang.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 java.util.Collection<java.lang.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 java.util.Collection<java.lang.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
-
-