Merge commit '4ec3a480cc987be9b86d2cf0a20fbf3ba442141f' into v3.x

isekai-main
Misty Release Bot 1 year ago
commit f46dde5425

@ -1,3 +1,35 @@
#### v3.3.8 (2023-08-23)
##### Chores
* incrementing version number - v3.3.7 (b26f1744)
* update changelog for v3.3.7 (1193fa04)
* incrementing version number - v3.3.6 (7fb38792)
* incrementing version number - v3.3.4 (a67f84ea)
* incrementing version number - v3.3.3 (f94d239b)
* incrementing version number - v3.3.2 (ec9dac97)
* incrementing version number - v3.3.1 (151cc68f)
* incrementing version number - v3.3.0 (fc1ad70f)
* incrementing version number - v3.2.3 (b06d3e63)
* incrementing version number - v3.2.2 (758ecfcd)
* incrementing version number - v3.2.1 (20145074)
* incrementing version number - v3.2.0 (9ecac38e)
* incrementing version number - v3.1.7 (0b4e81ab)
* incrementing version number - v3.1.6 (b3a3b130)
* incrementing version number - v3.1.5 (ec19343a)
* incrementing version number - v3.1.4 (2452783c)
* incrementing version number - v3.1.3 (3b4e9d3f)
* incrementing version number - v3.1.2 (40fa3489)
* incrementing version number - v3.1.1 (40250733)
* incrementing version number - v3.1.0 (0cb386bd)
* incrementing version number - v3.0.1 (26f6ea49)
* incrementing version number - v3.0.0 (224e08cd)
##### Bug Fixes
* msg ref (4ba76338)
* #11947, make user message has a numeric timestamp (2d62a772)
#### v3.3.7 (2023-08-23)
##### Chores

@ -98,7 +98,7 @@
"nodebb-plugin-emoji": "5.1.5",
"nodebb-plugin-emoji-android": "4.0.0",
"nodebb-plugin-markdown": "12.1.7",
"nodebb-plugin-mentions": "4.3.4",
"nodebb-plugin-mentions": "4.3.5",
"nodebb-plugin-ntfy": "1.4.0",
"nodebb-plugin-spam-be-gone": "2.1.1",
"nodebb-rewards-essentials": "0.2.3",

@ -55,7 +55,7 @@ Groups.removeEphemeralGroups = function (groups) {
return groups;
};
const isPrivilegeGroupRegex = /^cid:\d+:privileges:[\w\-:]+$/;
const isPrivilegeGroupRegex = /^cid:(?:\d+|admin):privileges:[\w\-:]+$/;
Groups.isPrivilegeGroup = function (groupName) {
return isPrivilegeGroupRegex.test(groupName);
};

@ -1404,4 +1404,20 @@ describe('Groups', () => {
assert(!groupData['cover:url']);
});
});
describe('isPrivilegeGroup', () => {
assert.strictEqual(Groups.isPrivilegeGroup('cid:1:privileges:topics:find'), true);
assert.strictEqual(Groups.isPrivilegeGroup('cid:1:privileges:groups:topics:find'), true);
assert.strictEqual(Groups.isPrivilegeGroup('cid:0:privileges:groups:search:users'), true);
assert.strictEqual(Groups.isPrivilegeGroup('cid:admin:privileges:admin:users'), true);
assert.strictEqual(Groups.isPrivilegeGroup('cid::privileges:admin:users'), false);
assert.strictEqual(Groups.isPrivilegeGroup('cid:string:privileges:admin:users'), false);
assert.strictEqual(Groups.isPrivilegeGroup('admin'), false);
assert.strictEqual(Groups.isPrivilegeGroup('registered-users'), false);
assert.strictEqual(Groups.isPrivilegeGroup(''), false);
assert.strictEqual(Groups.isPrivilegeGroup(null), false);
assert.strictEqual(Groups.isPrivilegeGroup(undefined), false);
assert.strictEqual(Groups.isPrivilegeGroup(false), false);
assert.strictEqual(Groups.isPrivilegeGroup(true), false);
});
});

Loading…
Cancel
Save