fix: privileges added by plugins (#9802)

* fix: privileges added by plugins

when copying a categories privileges, privileges added by plugins will be copied as well
when purging a category privileges added by plugins will be purged as well
show plugin privileges in privileges.<categories/admin/global>.get
show plugin privileges in privileges.<categories/admin/global>.userPrivileges
show plugin privileges in privileges.<categories/admin/global>.groupPrivileges

* fix: typo
This commit is contained in:
Barış Soner Uşaklı
2021-09-11 16:43:48 -04:00
committed by GitHub
parent 506035b5f7
commit 3ecbb624d8
7 changed files with 62 additions and 18 deletions

View File

@@ -48,7 +48,8 @@ module.exports = function (Categories) {
`cid:${cid}:tag:whitelist`,
`category:${cid}`,
]);
await groups.destroy(privileges.categories.privilegeList.map(privilege => `cid:${cid}:privileges:${privilege}`));
const privilegeList = await privileges.categories.getPrivilegeList();
await groups.destroy(privilegeList.map(privilege => `cid:${cid}:privileges:${privilege}`));
}
async function removeFromParent(cid) {