mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 17:35:46 +01:00
fix: #12389, update privilege group check
This commit is contained in:
@@ -56,7 +56,7 @@ Groups.removeEphemeralGroups = function (groups) {
|
||||
return groups;
|
||||
};
|
||||
|
||||
const isPrivilegeGroupRegex = /^cid:(?:\d+|admin):privileges:[\w\-:]+$/;
|
||||
const isPrivilegeGroupRegex = /^cid:(?:-?\d+|admin):privileges:[\w\-:]+$/;
|
||||
Groups.isPrivilegeGroup = function (groupName) {
|
||||
return isPrivilegeGroupRegex.test(groupName);
|
||||
};
|
||||
|
||||
@@ -233,7 +233,7 @@ function hookHandlerPromise(hook, hookObj, params) {
|
||||
if (hook.startsWith('filter:') && returned !== undefined) {
|
||||
_resolve(returned);
|
||||
} else if (hook.startsWith('static:') && hookObj.method.length <= 1) {
|
||||
// make sure it is resolved if static hook doesn't return anything and doesn't use callback
|
||||
// make sure it is resolved if static hook doesn't use callback
|
||||
_resolve();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user