Class UserRoleController


  • @Controller
    @RequestMapping("/")
    public class UserRoleController
    extends AbstractController
    • Constructor Detail

      • UserRoleController

        public UserRoleController()
    • Method Detail

      • getRolesList

        @RequestMapping(value="/roles",
                        method=GET,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<List<MLRole>> getRolesList()
        Returns:
        List roles in JSON format.
      • getRoleDetails

        @RequestMapping(value="/role/{roleId}",
                        method=GET,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<MLRole> getRoleDetails​(javax.servlet.http.HttpServletRequest request,
                                                   @PathVariable("roleId")
                                                   String roleId,
                                                   javax.servlet.http.HttpServletResponse response)
        Parameters:
        request - HttpServletRequest
        roleId - role ID
        response - HttpServletResponse
        Returns:
        object in JSON format.
      • postRole

        @RequestMapping(value="/createRole",
                        method=POST,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<org.acumos.cds.domain.MLPRole> postRole​(javax.servlet.http.HttpServletRequest request,
                                                                    @RequestBody
                                                                    JsonRequest<MLRole> role,
                                                                    javax.servlet.http.HttpServletResponse response)
        Parameters:
        request - HttpServletRequest
        role - Role
        response - HttpServletResponse
        Returns:
        object in JSON format.
      • updateRole

        @RequestMapping(value="/updateRole/{roleId}",
                        method=PUT,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<Object> updateRole​(@RequestParam(value="roleId",required=true)
                                               String roleId,
                                               @RequestBody
                                               JsonRequest<MLRole> role)
        Parameters:
        role - Role
        Returns:
        success message
      • deleteRole

        @RequestMapping(value="/deleteRole/{roleId}",
                        method=POST,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<Object> deleteRole​(@PathVariable("roleId")
                                               String roleId)
        Parameters:
        roleId - role ID
        Returns:
        Success or error message
      • getRoleFunction

        @RequestMapping(value="/roleFunction/{roleId}/{roleFunctionId}",
                        method=GET,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<MLRoleFunction> getRoleFunction​(@RequestBody
                                                            JsonRequest<MLRoleFunction> roleFunction)
        Parameters:
        roleFunction - Role function
        Returns:
        object in JSON format.
      • createRoleFunction

        @RequestMapping(value="/createRoleFunction",
                        method=POST,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<org.acumos.cds.domain.MLPRoleFunction> createRoleFunction​(@RequestBody
                                                                                      JsonRequest<org.acumos.cds.domain.MLPRoleFunction> mlpRoleFunction)
        Parameters:
        mlpRoleFunction - Role function
        Returns:
        object in JSON format.
      • updateRoleFunction

        @RequestMapping(value="/updateRoleFunction",
                        method=PUT,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<Object> updateRoleFunction​(@RequestBody
                                                       JsonRequest<org.acumos.cds.domain.MLPRoleFunction> mlpRoleFunction)
        Parameters:
        mlpRoleFunction - Role function
        Returns:
        Success or error message
      • deleteRoleFunction

        @RequestMapping(value="/deleteRoleFunction/{roleId}/{roleFunctionId}",
                        method=DELETE,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<Object> deleteRoleFunction​(@RequestBody
                                                       JsonRequest<MLRoleFunction> roleFunction)
        Parameters:
        roleFunction - Role function
        Returns:
        Success or error message
      • updateUserRole

        @RequestMapping(value="/roles/updateRole",
                        method=POST,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<org.acumos.cds.domain.MLPRole> updateUserRole​(@RequestBody
                                                                          JsonRequest<List<User>> userList)
      • getRolesForUser

        @RequestMapping(value="/roles/{userId}",
                        method=GET,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<List<MLRole>> getRolesForUser​(javax.servlet.http.HttpServletRequest request,
                                                          @PathVariable("userId")
                                                          String userId,
                                                          javax.servlet.http.HttpServletResponse response)
      • changeUserRoles

        @RequestMapping(value="/roles/user/change",
                        method=PUT,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<org.acumos.cds.domain.MLPRole> changeUserRoles​(@RequestBody
                                                                           JsonRequest<User> user)
      • getRoleUsersCount

        @RequestMapping(value="/roles/count",
                        method=GET,
                        produces="application/json")
        @ResponseBody
        public JsonResponse<List<MLRole>> getRoleUsersCount()