fix: prevent update root role in DomainPermissionHandler (#984)

This commit is contained in:
Baoshuo authored and GitHub committed 2025-05-25 12:50:46 +01:00
1 parent ea2850a51e
commit 80a9c6a399
1 file changed
+1
+1
View File
@@ -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]];