F4.5 · SMTP Superadmin y Report Word al Inspector
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import 'reflect-metadata';
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { REQUIRED_PERMISSIONS_KEY } from '../../src/authorization/decorators/require-permissions.decorator';
|
||||
import { SmtpSettingsController } from '../../src/inspection-reports/smtp-settings.controller';
|
||||
|
||||
function permissions(method: string): string[] {
|
||||
const handler = SmtpSettingsController.prototype[
|
||||
method as keyof SmtpSettingsController
|
||||
];
|
||||
return Reflect.getMetadata(REQUIRED_PERMISSIONS_KEY, handler) as string[];
|
||||
}
|
||||
|
||||
test('F4 SMTP configuration is restricted to the programmer Superadmin permission', () => {
|
||||
assert.deepEqual(permissions('get'), ['system_mail.manage']);
|
||||
assert.deepEqual(permissions('update'), ['system_mail.manage']);
|
||||
assert.deepEqual(permissions('test'), ['system_mail.manage']);
|
||||
});
|
||||
Reference in New Issue
Block a user