예제 #1
0
 public ManageRoleResponse RevokeRole([FromBody]
                                      ManageRoleRequest manageRoleRequest)
 {
     try
     {
         _userService.RevokeRole(manageRoleRequest.EmailAddress, manageRoleRequest.Role);
         return(new ManageRoleResponse());
     }
     catch (Exception ex)
     {
         return(new ManageRoleResponse
         {
             Success = false,
             Message = ex.Message
         });
     }
 }
예제 #2
0
        public async Task <ManageRoleResponse> RevokeRole(string emailAddress,
                                                          string role)
        {
            var manageRoleRequest = new ManageRoleRequest
            {
                EmailAddress = emailAddress,
                Role         = role
            };

            var baseApiResult =
                await PutRequest <ManageRoleResponse>("RevokeRole", manageRoleRequest);

            if (!baseApiResult.Success)
            {
                throw new Exception(baseApiResult.Message);
            }

            return(baseApiResult.Response);
        }
 public bool UpdateUserRole(ManageRoleRequest roleReq)
 {
     return(new UserController().UpdateUserRole(roleReq.UserId, roleReq.RoleCode));
 }