mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
feat: add privilege give/rescind hooks (#8336)
* feat: add privilege give/rescind hooks action:privileges.categories.give/rescind action:privileges.global.give/rescind breaking change, privileges.categories.give/rescind and privileges.global.give/rescind use full privilege name for groups ie `groups:find` instead of `find` * fix: tests, privileges renamed
This commit is contained in:
committed by
GitHub
parent
a0e243eea1
commit
ec5582b53c
@@ -330,13 +330,13 @@ describe('authentication', function () {
|
||||
});
|
||||
|
||||
it('should fail to login if local login is disabled', function (done) {
|
||||
privileges.global.rescind(['local:login'], 'registered-users', function (err) {
|
||||
privileges.global.rescind(['groups:local:login'], 'registered-users', function (err) {
|
||||
assert.ifError(err);
|
||||
loginUser('regular', 'regularpwd', function (err, response, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(response.statusCode, 403);
|
||||
assert.equal(body, '[[error:local-login-disabled]]');
|
||||
privileges.global.give(['local:login'], 'registered-users', done);
|
||||
privileges.global.give(['groups:local:login'], 'registered-users', done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user