Interface RoleService
-
@Path("/security/role") @Consumes({"application/xml","application/json"}) @Produces({"application/xml","application/json"}) public interface RoleServiceManages the roles in XL Deploy's security system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidassign(java.lang.String name, java.lang.String principal)Assigns a role to a user or group.voidcreate(java.lang.String name)Creates a new role.voiddelete(java.lang.String name)Removes a role from the XL Deploy security system.booleanexists(java.lang.String roleName)Checks if role with given name existsdefault java.util.List<java.lang.String>list()Lists the names of all available roles in the security system.java.util.List<java.lang.String>list(java.lang.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.java.util.List<Role>list(java.lang.String id, java.lang.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 IDdefault java.util.List<java.lang.String>listMyRoles()Lists the roles of the currently logged in user.java.util.List<java.lang.String>listMyRoles(java.lang.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.default java.util.List<java.lang.String>listRoles(java.lang.String username)Lists the roles of a user.java.util.List<java.lang.String>listRoles(java.lang.String username, java.lang.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 java.util.List<RolePrincipals>readRolePrincipals()Lists all role principals available in the security system.java.util.List<RolePrincipals>readRolePrincipals(java.lang.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 patternvoidrename(java.lang.String name, java.lang.String newName)Renames a role.voidunassign(java.lang.String name, java.lang.String principal)Removes a role from a user or group.voidupdatePrincipals(RolePrincipals rolePrincipals)Update principals for existing rolevoidupdatePrincipals(java.lang.String name, java.util.List<java.lang.String> principals)Assigns a role to a user or group.
-
-
-
Method Detail
-
exists
@GET @Path("exists/{name}") boolean exists(@PathParam("name") java.lang.String roleName)Checks if role with given name exists- Parameters:
roleName- checked role name- Returns:
- true or false
-
list
@GET @Path("v2/{id:.+}") java.util.List<Role> list(@PathParam("id") java.lang.String id, @QueryParam("rolePattern") java.lang.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") java.util.List<java.lang.String> list(@QueryParam("rolePattern") java.lang.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
@GET default java.util.List<java.lang.String> list()
Lists the names of all available roles in the security system.- Returns:
- a list of role names.
-
listMyRoles
@GET @Path("v2/roles") java.util.List<java.lang.String> listMyRoles(@QueryParam("rolePattern") java.lang.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
@GET @Path("roles") default java.util.List<java.lang.String> listMyRoles()Lists the roles of the currently logged in user.- Returns:
- a list of role names.
-
listRoles
@GET @Path("v2/roles/{username}") java.util.List<java.lang.String> listRoles(@PathParam("username") java.lang.String username, @QueryParam("rolePattern") java.lang.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 java.util.List<java.lang.String> listRoles(@PathParam("username") java.lang.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
@PUT @Path("{role}") void create(@PathParam("role") java.lang.String name)Creates a new role. Does nothing if the role already exists.- Parameters:
name- the name of the new role.- Permission:
- security#edit
-
updatePrincipals
@POST @Path("principals") void updatePrincipals(RolePrincipals rolePrincipals)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") java.lang.String name, java.util.List<java.lang.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") java.lang.String name, @PathParam("principal") java.lang.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") java.lang.String name, @PathParam("principal") java.lang.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
@POST @Path("{role}") void rename(@PathParam("role") java.lang.String name, java.lang.String newName)Renames a role. Does nothing if the role does not exist.- Parameters:
name- the current namenewName- the new name- Permission:
- security#edit
-
delete
@DELETE @Path("{role}") void delete(@PathParam("role") java.lang.String name)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") java.util.List<RolePrincipals> readRolePrincipals(@QueryParam("rolePattern") java.lang.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
@GET @Path("principals") default java.util.List<RolePrincipals> readRolePrincipals()Lists all role principals available in the security system.
-
-