mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 02:36:16 +01:00
feat: column based view on wide priv. tables (#9699)
* feat: column based view on wide priv. tables * fix: add group/user * feat: copy buttons to work on visible privs * feat: show what's being copied in modal * feat: optional title and message for category selector modal
This commit is contained in:
@@ -73,15 +73,15 @@ Categories.copyPrivilegesToChildren = async function (socket, data) {
|
||||
const children = result[0];
|
||||
for (const child of children) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await copyPrivilegesToChildrenRecursive(data.cid, child, data.group);
|
||||
await copyPrivilegesToChildrenRecursive(data.cid, child, data.group, data.filter);
|
||||
}
|
||||
};
|
||||
|
||||
async function copyPrivilegesToChildrenRecursive(parentCid, category, group) {
|
||||
await categories.copyPrivilegesFrom(parentCid, category.cid, group);
|
||||
async function copyPrivilegesToChildrenRecursive(parentCid, category, group, filter) {
|
||||
await categories.copyPrivilegesFrom(parentCid, category.cid, group, filter);
|
||||
for (const child of category.children) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await copyPrivilegesToChildrenRecursive(parentCid, child, group);
|
||||
await copyPrivilegesToChildrenRecursive(parentCid, child, group, filter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ Categories.copySettingsFrom = async function (socket, data) {
|
||||
};
|
||||
|
||||
Categories.copyPrivilegesFrom = async function (socket, data) {
|
||||
await categories.copyPrivilegesFrom(data.fromCid, data.toCid, data.group);
|
||||
await categories.copyPrivilegesFrom(data.fromCid, data.toCid, data.group, data.filter);
|
||||
};
|
||||
|
||||
Categories.copyPrivilegesToAllCategories = async function (socket, data) {
|
||||
@@ -98,6 +98,6 @@ Categories.copyPrivilegesToAllCategories = async function (socket, data) {
|
||||
cids = cids.filter(cid => parseInt(cid, 10) !== parseInt(data.cid, 10));
|
||||
for (const toCid of cids) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await categories.copyPrivilegesFrom(data.cid, toCid, data.group);
|
||||
await categories.copyPrivilegesFrom(data.cid, toCid, data.group, data.filter);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user