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 Type
    Method
    Description
    void
    assign(String name, String principal)
    Assigns a role to a user or group.
    void
    create(String name)
    Creates a new role.
    void
    delete(String name)
    Removes a role from the XL Deploy security system.
    boolean
    exists(String roleName)
    Checks if role with given name exists
    default List<String>
    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 ID
    default List<String>
    Lists 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.
    default List<String>
    listRoles(String username)
    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.
    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 pattern
    void
    rename(String name, String newName)
    Renames a role.
    void
    unassign(String name, String principal)
    Removes a role from a user or group.
    void
    Update principals for existing role
    void
    updatePrincipals(String name, List<String> principals)
    Assigns a role to a user or group.
  • Method Details

    • exists

      @GET @Path("exists/{name}") boolean exists(@PathParam("name") String roleName)
      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 ID
      rolePattern - the role name pattern used for search
      paging - search paging
      order - 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

      @GET default List<String> 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

      @GET @Path("roles") default List<String> 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

      @PUT @Path("{role}") void create(@PathParam("role") 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") 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 assign
      principals - 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 assign
      principal - 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 remove
      principal - the user or group to remove the role from.
      Permission:
      security#edit
    • rename

      @POST @Path("{role}") void rename(@PathParam("role") String name, String newName)
      Renames a role. Does nothing if the role does not exist.
      Parameters:
      name - the current name
      newName - the new name
      Permission:
      security#edit
    • delete

      @DELETE @Path("{role}") void delete(@PathParam("role") 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") 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 search
      paging - search paging
      order - search order
    • readRolePrincipals

      @GET @Path("principals") default List<RolePrincipals> readRolePrincipals()
      Lists all role principals available in the security system.