Interface RoleService
@Path("/security/role")
@Consumes({"application/xml","application/json"})
@Produces({"application/xml","application/json"})
public interface RoleService
Manages the roles in XL Deploy's security system.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Assigns a role to a user or group.void
Creates a new role.void
Removes a role from the XL Deploy security system.boolean
Checks if role with given name existslist()
Lists the names of all available roles in the security system.list
(String rolePattern, com.xebialabs.deployit.engine.api.dto.Paging paging, com.xebialabs.deployit.engine.api.dto.Ordering order) Lists the names of all available roles in the security system.list
(String id, String rolePattern, com.xebialabs.deployit.engine.api.dto.Paging paging, com.xebialabs.deployit.engine.api.dto.Ordering order) List the roles for given configuration item IDLists the roles of the currently logged in user.listMyRoles
(String rolePattern, com.xebialabs.deployit.engine.api.dto.Paging paging, com.xebialabs.deployit.engine.api.dto.Ordering order) Lists the roles of the currently logged in user.Lists the roles of a user.listRoles
(String username, String rolePattern, com.xebialabs.deployit.engine.api.dto.Paging paging, com.xebialabs.deployit.engine.api.dto.Ordering order) Lists the roles of a user.default List<RolePrincipals>
Lists all role principals available in the security system.readRolePrincipals
(String rolePattern, com.xebialabs.deployit.engine.api.dto.Paging paging, com.xebialabs.deployit.engine.api.dto.Ordering order) Lists paged role principals available in the security system for given role name patternvoid
Renames a role.void
Removes a role from a user or group.void
updatePrincipals
(RolePrincipals rolePrincipals) Update principals for existing rolevoid
updatePrincipals
(String name, List<String> principals) Assigns a role to a user or group.
-
Method Details
-
exists
Checks if role with given name exists- Parameters:
roleName
- checked role name- Returns:
- true or false
-
list
@GET @Path("v2/{id:.+}") List<Role> list(@PathParam("id") String id, @QueryParam("rolePattern") String rolePattern, @BeanParam com.xebialabs.deployit.engine.api.dto.Paging paging, @QueryParam("order") com.xebialabs.deployit.engine.api.dto.Ordering order) List the roles for given configuration item ID- Parameters:
id
- configuration item IDrolePattern
- the role name pattern used for searchpaging
- search pagingorder
- search order- Returns:
- a list of roles.
-
list
@GET @Path("v2") List<String> list(@QueryParam("rolePattern") String rolePattern, @BeanParam com.xebialabs.deployit.engine.api.dto.Paging paging, @QueryParam("order") com.xebialabs.deployit.engine.api.dto.Ordering order) Lists the names of all available roles in the security system.- Returns:
- a list of role names.
-
list
Lists the names of all available roles in the security system.- Returns:
- a list of role names.
-
listMyRoles
@GET @Path("v2/roles") List<String> listMyRoles(@QueryParam("rolePattern") String rolePattern, @BeanParam com.xebialabs.deployit.engine.api.dto.Paging paging, @QueryParam("order") com.xebialabs.deployit.engine.api.dto.Ordering order) Lists the roles of the currently logged in user.- Returns:
- a list of role names.
-
listMyRoles
Lists the roles of the currently logged in user.- Returns:
- a list of role names.
-
listRoles
@GET @Path("v2/roles/{username}") List<String> listRoles(@PathParam("username") String username, @QueryParam("rolePattern") String rolePattern, @BeanParam com.xebialabs.deployit.engine.api.dto.Paging paging, @QueryParam("order") com.xebialabs.deployit.engine.api.dto.Ordering order) Lists the roles of a user.- Parameters:
username
- the username of the principal- Returns:
- a list of role names.
- Permission:
- security#edit
-
listRoles
@GET @Path("roles/{username}") default List<String> listRoles(@PathParam("username") String username) Lists the roles of a user.- Parameters:
username
- the username of the principal- Returns:
- a list of role names.
- Permission:
- security#edit
-
create
Creates a new role. Does nothing if the role already exists.- Parameters:
name
- the name of the new role.- Permission:
- security#edit
-
updatePrincipals
Update principals for existing role- Parameters:
rolePrincipals
- rolePrincipals.role for which the rolePrincipals.principals is applied to
-
updatePrincipals
@POST @Path("{role}/principals") void updatePrincipals(@PathParam("role") String name, List<String> principals) Assigns a role to a user or group. The role will be created if it doesn't exist yet.- Parameters:
name
- the name of the role to assignprincipals
- the user or group to assign the role to.- Permission:
- security#edit
-
assign
@PUT @Path("{role}/{principal}") void assign(@PathParam("role") String name, @PathParam("principal") String principal) Assigns a role to a user or group. The role will be created if it doesn't exist yet.- Parameters:
name
- the name of the role to assignprincipal
- the user or group to assign the role to.- Permission:
- security#edit
-
unassign
@DELETE @Path("{role}/{principal}") void unassign(@PathParam("role") String name, @PathParam("principal") String principal) Removes a role from a user or group.- Parameters:
name
- the name of the role to removeprincipal
- the user or group to remove the role from.- Permission:
- security#edit
-
rename
Renames a role. Does nothing if the role does not exist.- Parameters:
name
- the current namenewName
- the new name- Permission:
- security#edit
-
delete
Removes a role from the XL Deploy security system. All assignments to principals are deleted as well.- Parameters:
name
- the name of the role to delete.- Permission:
- security#edit
-
readRolePrincipals
@GET @Path("v2/principals") List<RolePrincipals> readRolePrincipals(@QueryParam("rolePattern") String rolePattern, @BeanParam com.xebialabs.deployit.engine.api.dto.Paging paging, @QueryParam("order") com.xebialabs.deployit.engine.api.dto.Ordering order) Lists paged role principals available in the security system for given role name pattern- Parameters:
rolePattern
- the role name pattern used for searchpaging
- search pagingorder
- search order
-
readRolePrincipals
Lists all role principals available in the security system.
-