jetbrains.buildServer.serverSide.auth
Interface RolesHolder

All Known Subinterfaces:
SUser, SUserGroup

public interface RolesHolder

Roles container


Method Summary
 void addRole(RoleScope scope, Role role)
          Adds role with specified scope
 java.util.Collection<RolesHolder> getAllParentHolders()
          Returns all parent holders including transitive ones
 java.util.Collection<RolesHolder> getParentHolders()
          Returns direct (non transitive) parent holders.
 java.util.Collection<RoleEntry> getRoles()
          Returns roles with their scopes
 java.util.Collection<Role> getRolesWithScope(RoleScope scope)
          Returns all roles with specified scope.
 java.util.Collection<RoleScope> getScopes()
          Returns all scopes with assigned roles
 boolean isSystemAdministratorRoleGranted()
          Returns true if this roles holder contains system administrator role granted directly or inherited via parent holders.
 boolean isSystemAdministratorRoleGrantedDirectly()
          Returns true if this roles holder contains system administrator role granted directly.
 boolean isSystemAdministratorRoleInherited()
          Returns true if one of the parents (transitively) of this roles holder contains system administrator role.
 void removeRole(Role role)
          Removes specified role.
 void removeRole(RoleScope scope, Role role)
          Removes role with specified scope
 void removeRoles(RoleScope scope)
          Removes all of the roles having the specified scope.
 

Method Detail

getRolesWithScope

@NotNull
java.util.Collection<Role> getRolesWithScope(@NotNull
                                                     RoleScope scope)
Returns all roles with specified scope.

Parameters:
scope - roles scope
Returns:
all roles with specified scope.

getScopes

java.util.Collection<RoleScope> getScopes()
Returns all scopes with assigned roles

Returns:
all scopes with assigned roles

getRoles

@NotNull
java.util.Collection<RoleEntry> getRoles()
Returns roles with their scopes

Returns:
roles with their scopes

addRole

void addRole(@NotNull
             RoleScope scope,
             @NotNull
             Role role)
Adds role with specified scope

Parameters:
scope - scope of the role
role - role

removeRole

void removeRole(@NotNull
                RoleScope scope,
                @NotNull
                Role role)
Removes role with specified scope

Parameters:
scope - scope of the role
role - role

removeRole

void removeRole(@NotNull
                Role role)
Removes specified role. If the role is associated with several scopes all of these roles will be removed.

Parameters:
role - role to remove

removeRoles

void removeRoles(@NotNull
                 RoleScope scope)
Removes all of the roles having the specified scope.

Parameters:
scope - scope of the role

isSystemAdministratorRoleGranted

boolean isSystemAdministratorRoleGranted()
Returns true if this roles holder contains system administrator role granted directly or inherited via parent holders. Same as:
isSystemAdministratorRoleGrantedDirectly() || isSystemAdministratorRoleInherited()

Returns:
see above.

isSystemAdministratorRoleGrantedDirectly

boolean isSystemAdministratorRoleGrantedDirectly()
Returns true if this roles holder contains system administrator role granted directly.

Returns:
see above.

isSystemAdministratorRoleInherited

boolean isSystemAdministratorRoleInherited()
Returns true if one of the parents (transitively) of this roles holder contains system administrator role.

Returns:
see above

getParentHolders

@NotNull
java.util.Collection<RolesHolder> getParentHolders()
Returns direct (non transitive) parent holders.

Returns:
parent holders

getAllParentHolders

@NotNull
java.util.Collection<RolesHolder> getAllParentHolders()
Returns all parent holders including transitive ones

Returns:
all parent holders