diff options
author | crupest <crupest@outlook.com> | 2020-11-15 20:31:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-15 20:31:22 +0800 |
commit | 667143d870679deb4be55122237e66d2d480946f (patch) | |
tree | da5c5c4f4b0edcc827182a448bed0e7cc5ec1729 /BackEnd/Timeline/Controllers/UserController.cs | |
parent | 63ec1050dd24e4123f73e9ed757376dc8128803d (diff) | |
download | timeline-667143d870679deb4be55122237e66d2d480946f.tar.gz timeline-667143d870679deb4be55122237e66d2d480946f.tar.bz2 timeline-667143d870679deb4be55122237e66d2d480946f.zip |
feat: Now changing user permission returns 400.
Diffstat (limited to 'BackEnd/Timeline/Controllers/UserController.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/UserController.cs | 8 |
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());
+ }
}
}
}
|