mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
fix: prevent update root role in DomainPermissionHandler (#984)
This commit is contained in:
1 parent
ea2850a51e
commit
80a9c6a399
1 file changed
+1
@@ -214,6 +214,7 @@ class DomainPermissionHandler extends ManageHandler {
|
|||||||
async post({ domainId }) {
|
async post({ domainId }) {
|
||||||
const roles = {};
|
const roles = {};
|
||||||
for (const role in this.request.body) {
|
for (const role in this.request.body) {
|
||||||
|
if (role === 'root') continue; // root role is not editable
|
||||||
const perms = this.request.body[role] instanceof Array
|
const perms = this.request.body[role] instanceof Array
|
||||||
? this.request.body[role]
|
? this.request.body[role]
|
||||||
: [this.request.body[role]];
|
: [this.request.body[role]];
|
||||||
|
|||||||
Reference in new issue
Block a user