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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void assign​(java.lang.String name, java.lang.String principal)
      Assigns a role to a user or group.
      void create​(java.lang.String name)
      Creates a new role.
      void delete​(java.lang.String name)
      Removes a role from the XL Deploy security system.
      boolean exists​(java.lang.String roleName)
      Checks if role with given name exists
      default 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 ID
      default 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 pattern
      void rename​(java.lang.String name, java.lang.String newName)
      Renames a role.
      void unassign​(java.lang.String name, java.lang.String principal)
      Removes a role from a user or group.
      void updatePrincipals​(RolePrincipals rolePrincipals)
      Update principals for existing role
      void updatePrincipals​(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 ID
        rolePattern - the role name pattern used for search
        paging - search paging
        order - 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 assign
        principals - 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 assign
        principal - 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 remove
        principal - 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 name
        newName - 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 search
        paging - search paging
        order - search order
      • readRolePrincipals

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