jetbrains.buildServer.serverSide.auth
Interface AuthorityHolder

All Known Subinterfaces:
SUser, SUserGroup
All Known Implementing Classes:
UserData

public interface AuthorityHolder

Authority holder


Method Summary
 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 globally
 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 isPermissionGrantedForAnyProject(Permission permission)
          Returns true if specified permission is granted for at least one project
 boolean 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.

Returns:
map of project permissions

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 id
permission - permission to check
Returns:
see above

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

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 association Permission.isProjectAssociationSupported()).

Parameters:
projectId - project id
Returns:
all granted permissions for particular project

getAssociatedUser

@Nullable
User getAssociatedUser()
Returns the user object associated with the principal.

Returns:
may be null if the authority holder is not a user.