Interface RoleService

  • All Known Implementing Classes:
    DefaultRoleService

    @Path("/roles")
    public interface RoleService
    Service interface for role management.
    Since:
    3.0
    Author:
    Olivier Lamy, Martin Stockhammer
    • Method Detail

      • moveTemplatedRole

        @Path("templates/{templateId}/{oldResource}/moveto/{newResource}")
        @POST
        @Produces("application/json")
        RoleInfo moveTemplatedRole​(@PathParam("templateId")
                                   String templateId,
                                   @PathParam("oldResource")
                                   String oldResource,
                                   @PathParam("newResource")
                                   String newResource)
                            throws RedbackServiceException
        Moves a templated role from one resource to another resource
        Parameters:
        templateId - the template identifier
        oldResource - the resource of the current role
        newResource - the resource of the new role
        Throws:
        RedbackServiceException
      • removeTemplatedRole

        @Path("templates/{templateId}/{resource}")
        @DELETE
        @Produces("application/json")
        javax.ws.rs.core.Response removeTemplatedRole​(@PathParam("templateId")
                                                      String templateId,
                                                      @PathParam("resource")
                                                      String resource)
                                               throws RedbackServiceException
        Removes a role corresponding to the role Id that was manufactured with the given resource it also removes any user assignments for that role
        Parameters:
        templateId -
        resource -
        Throws:
        RedbackServiceException
      • assignTemplatedRole

        @Path("templates/{templateId}/{resource}/user/{userId}")
        @PUT
        @Produces("application/json")
        RoleInfo assignTemplatedRole​(@PathParam("templateId")
                                     String templateId,
                                     @PathParam("resource")
                                     String resource,
                                     @PathParam("userId")
                                     String userId)
                              throws RedbackServiceException
        Assigns the templated role indicated by the templateId fails if the templated role has not been created
        Parameters:
        templateId -
        resource -
        userId -
        Throws:
        RedbackServiceException
      • getRoleUsers

        @Path("{roleId}/user")
        @GET
        @Produces("application/json")
        org.apache.archiva.components.rest.model.PagedResult<UserInfogetRoleUsers​(@PathParam("roleId")
                                                                                    String roleId,
                                                                                    @QueryParam("recurse")
                                                                                    String recurse,
                                                                                    @QueryParam("q") @DefaultValue("")
                                                                                    String searchTerm,
                                                                                    @QueryParam("offset") @DefaultValue("0")
                                                                                    Integer offset,
                                                                                    @QueryParam("limit") @DefaultValue("100")
                                                                                    Integer limit,
                                                                                    @QueryParam("orderBy") @DefaultValue("id")
                                                                                    List<String> orderBy,
                                                                                    @QueryParam("order") @DefaultValue("asc")
                                                                                    String order)
                                                                             throws RedbackServiceException
        This returns the list of assigned users to a given role. The flag "recurse" is a query parameter. If the query parameter exists and is not set to 'false', or '0', it will recurse all parent roles and return a list of users assigned to the current role and the parent roles up to the root. If the query parameter does not exist or is set to 'false' or '0', it will return only the users assigned directly to the given role.
        Parameters:
        roleId - the role identifier, for which the assigned users are returned
        recurse - if the parameter does not exist or is set to 'false' or '0', only directly assigned users are returned. If the parameter value is set to 'parentsOnly', the users assigned to all parent roles up to the root excluding the given role are returned. Otherwise all users assigned to the given role and all parent roles up to the root are returned.
        searchTerm - the substring query term to search for in the user ids and names
        offset - the offset index in the user list for paging
        limit - the maximum number of users returned
        orderBy - the order attributes for ordering
        order - the order direction 'asc' (ascending), or 'desc' (descending)
        Returns:
        the list of user objects
        Throws:
        RedbackServiceException
      • getUnassignedUsers

        @Path("{roleId}/unassigned")
        @GET
        @Produces("application/json")
        org.apache.archiva.components.rest.model.PagedResult<UserInfogetUnassignedUsers​(@PathParam("roleId")
                                                                                          String roleId,
                                                                                          @QueryParam("recurse")
                                                                                          String recurse,
                                                                                          @QueryParam("q") @DefaultValue("")
                                                                                          String searchTerm,
                                                                                          @QueryParam("offset") @DefaultValue("0")
                                                                                          Integer offset,
                                                                                          @QueryParam("limit") @DefaultValue("100")
                                                                                          Integer limit,
                                                                                          @QueryParam("orderBy") @DefaultValue("id")
                                                                                          List<String> orderBy,
                                                                                          @QueryParam("order") @DefaultValue("asc")
                                                                                          String order)
                                                                                   throws RedbackServiceException
        Throws:
        RedbackServiceException