core: fix root permission

This commit is contained in:
undefined committed 2021-08-01 10:59:46 +08:00
1 parent 0c3847b756
commit 739534f9f7
5 files changed
+12 -4

No files matched your search

+1 -1
View File
@@ -154,7 +154,7 @@ class DomainModel {
return roles;
}
static async setRoles(domainId: string, roles: Dictionary<bigint>) {
static async setRoles(domainId: string, roles: Dictionary<bigint | string>) {
deleteUserCache(domainId);
const current = await DomainModel.get(domainId);
for (const role in roles) {
+8
View File
@@ -427,6 +427,14 @@ const scripts: UpgradeScript[] = [
});
return true;
},
async function _38_39() {
const _FRESH_INSTALL_IGNORE = 1;
await iterateAllDomain(async (ddoc) => {
ddoc.roles.root = '-1';
await domain.setRoles(ddoc._id, ddoc.roles);
});
return true;
},
];
export default scripts;