aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-15 20:31:22 +0800
committercrupest <crupest@outlook.com>2020-11-15 20:31:22 +0800
commit5b7b0120406ef4c609c07ab57074a76a753cd1fd (patch)
treedd34d028426627375a3183c30d1494fcec55969b /BackEnd/Timeline/Controllers
parentfa7b123be84afe020fc582535cc270e8cf24e85b (diff)
downloadtimeline-5b7b0120406ef4c609c07ab57074a76a753cd1fd.tar.gz
timeline-5b7b0120406ef4c609c07ab57074a76a753cd1fd.tar.bz2
timeline-5b7b0120406ef4c609c07ab57074a76a753cd1fd.zip
feat: Now changing user permission returns 400.
Diffstat (limited to 'BackEnd/Timeline/Controllers')
-rw-r--r--BackEnd/Timeline/Controllers/UserController.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Controllers/UserController.cs b/BackEnd/Timeline/Controllers/UserController.cs
index bbdb5d57..da34cb1b 100644
--- a/BackEnd/Timeline/Controllers/UserController.cs
+++ b/BackEnd/Timeline/Controllers/UserController.cs
@@ -212,6 +212,10 @@ namespace Timeline.Controllers
{
return NotFound(ErrorResponse.UserCommon.NotExist());
}
+ catch (InvalidOperationOnRootUserException)
+ {
+ return BadRequest(ErrorResponse.UserController.ChangePermission_RootUser());
+ }
}
[HttpDelete("users/{username}/permissions/{permission}"), PermissionAuthorize(UserPermission.UserManagement)]
@@ -232,6 +236,10 @@ namespace Timeline.Controllers
{
return NotFound(ErrorResponse.UserCommon.NotExist());
}
+ catch (InvalidOperationOnRootUserException)
+ {
+ return BadRequest(ErrorResponse.UserController.ChangePermission_RootUser());
+ }
}
}
}