Class RoleImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.auth.RoleImpl
-
- All Implemented Interfaces:
Comparable<RoleImpl>,Loggable,Role
public class RoleImpl extends Object implements Role, Comparable<RoleImpl>
Role is a set of permissions and included roles with name and identifier.
-
-
Constructor Summary
Constructors Constructor Description RoleImpl(String id, String name, int orderNum, RoleManipulator manipulator)RoleImpl(String id, String name, Permissions permissions, int orderNum, RoleManipulator manipulator)RoleImpl(String id, String name, Permissions allowedPermissions, Permissions disabledPermissions, RoleManipulator manipulator)RoleImpl(String id, String name, Permissions permissions, RoleManipulator roleManipulator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIncludedRole(Role includedRole)IncludesincludedRoleto the rolevoidaddPermissions(Permission... permissions)Adds permissions to the roleintcompareTo(RoleImpl o)voidcomputeAllPermissions()Stringdescribe(boolean verbose)voiddisableProjectAssociation()By default we compute whether a role can be associated to a particular project by permissions containing in the role.voiddoAddDisabledPermissions(Permissions permissions)voiddoAddIncludedRole(Role role)voiddoAddPermissions(Permissions permissions)Adds permissions to the rolevoiddoRemoveIncludedRole(Role role)voiddoRemovePermission(Permission permission)booleanequals(Object o)PermissionsgetDisabledOwnPermissions()StringgetId()Returns unique identifier of this roleRole[]getIncludedRoles()Returns roles which are included in this roleStringgetName()Returns name of this roleintgetOrderNum()PermissionsgetOwnPermissions()Return only own permissions of the role without inherited permissionsPermissionsgetPermissions()Returns permissions associated with this roleinthashCode()booleanisProjectAssociationDisabled()booleanisProjectAssociationSupported()Returns true if this role can be associated with a particular project.voidremoveIncludedRole(Role includedRole)ExcludesincludedRolefrom the rolevoidremovePermission(Permission permission)Removes permission from the roleStringtoString()
-
-
-
Constructor Detail
-
RoleImpl
public RoleImpl(@NotNull String id, @NotNull String name, @NotNull Permissions permissions, @Nullable RoleManipulator roleManipulator)
-
RoleImpl
public RoleImpl(@NotNull String id, @NotNull String name, @NotNull Permissions permissions, int orderNum, @Nullable RoleManipulator manipulator)
-
RoleImpl
public RoleImpl(@NotNull String id, @NotNull String name, int orderNum, @Nullable RoleManipulator manipulator)
-
RoleImpl
public RoleImpl(@NotNull String id, @NotNull String name, @NotNull Permissions allowedPermissions, @NotNull Permissions disabledPermissions, RoleManipulator manipulator)
-
-
Method Detail
-
getOrderNum
public int getOrderNum()
-
disableProjectAssociation
public void disableProjectAssociation()
By default we compute whether a role can be associated to a particular project by permissions containing in the role. If role contains at least one project permissionPermission.isProjectAssociationSupported()returns true, we consider that this role can be associated with a project. But sometimes it is needed to override this behaviour and disable project association for some roles even if they contain project permissions (for example, Sysadmin role).
-
isProjectAssociationDisabled
public boolean isProjectAssociationDisabled()
-
getId
@NotNull public String getId()
Returns unique identifier of this role
-
getName
@NotNull public String getName()
Returns name of this role
-
getPermissions
@NotNull public Permissions getPermissions()
Returns permissions associated with this role- Specified by:
getPermissionsin interfaceRole- Returns:
- role permissions
-
getOwnPermissions
@NotNull public Permissions getOwnPermissions()
Description copied from interface:RoleReturn only own permissions of the role without inherited permissions- Specified by:
getOwnPermissionsin interfaceRole- Returns:
- own permissions of the role
-
getDisabledOwnPermissions
@NotNull public Permissions getDisabledOwnPermissions()
-
getIncludedRoles
@NotNull public Role[] getIncludedRoles()
Description copied from interface:RoleReturns roles which are included in this role- Specified by:
getIncludedRolesin interfaceRole- Returns:
- included roles
-
isProjectAssociationSupported
public boolean isProjectAssociationSupported()
Description copied from interface:RoleReturns true if this role can be associated with a particular project. This means that this role contains at least one permission that can be associated with a project.- Specified by:
isProjectAssociationSupportedin interfaceRole- Returns:
- true if this role can be associated with a project
-
addPermissions
public void addPermissions(@NotNull Permission... permissions)Description copied from interface:RoleAdds permissions to the role- Specified by:
addPermissionsin interfaceRole- Parameters:
permissions- permissions
-
removePermission
public void removePermission(@NotNull Permission permission)Description copied from interface:RoleRemoves permission from the role- Specified by:
removePermissionin interfaceRole- Parameters:
permission- permission
-
addIncludedRole
public void addIncludedRole(@NotNull Role includedRole)Description copied from interface:RoleIncludesincludedRoleto the role- Specified by:
addIncludedRolein interfaceRole- Parameters:
includedRole- role to include
-
removeIncludedRole
public void removeIncludedRole(@NotNull Role includedRole)Description copied from interface:RoleExcludesincludedRolefrom the role- Specified by:
removeIncludedRolein interfaceRole- Parameters:
includedRole- role to include
-
doAddPermissions
public void doAddPermissions(Permissions permissions)
Adds permissions to the role- Parameters:
permissions- adds permissions
-
doAddDisabledPermissions
public void doAddDisabledPermissions(Permissions permissions)
-
doRemovePermission
public void doRemovePermission(@NotNull Permission permission)
-
doAddIncludedRole
public void doAddIncludedRole(@NotNull Role role)
-
doRemoveIncludedRole
public void doRemoveIncludedRole(@NotNull Role role)
-
computeAllPermissions
public void computeAllPermissions()
-
compareTo
public int compareTo(RoleImpl o)
- Specified by:
compareToin interfaceComparable<RoleImpl>
-
-