refs #5475 fix accessScope
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2023-06-27 15:30:54 +02:00
parent 6ab431f8ef
commit 4b8b7a9d82
6 changed files with 14 additions and 5 deletions

View File

@ -71,8 +71,6 @@ fdescribe('VnUser Sign-in()', () => {
expect(error).toBeDefined(); expect(error).toBeDefined();
expect(error.statusCode).toBe(403); expect(error.statusCode).toBe(403);
expect(error.message).toBe('REQUIRES_2FA'); expect(error.message).toBe('REQUIRES_2FA');
await employee.updateAttribute('twoFactor', null);
}); });
}); });

View File

@ -1,6 +1,6 @@
const {models} = require('vn-loopback/server/server'); const {models} = require('vn-loopback/server/server');
fdescribe('VnUser validate-auth()', () => { describe('VnUser validate-auth()', () => {
describe('validateAuth', () => { describe('validateAuth', () => {
it('should signin if data is correct', async() => { it('should signin if data is correct', async() => {
await models.AuthCode.create({ await models.AuthCode.create({

View File

@ -22,7 +22,7 @@
autocomplete="false"> autocomplete="false">
</vn-textfield> </vn-textfield>
<vn-textfield <vn-textfield
ng-if="$ctrl.$state.params.twoFactor" ng-if="$ctrl.$state.params.twoFactor == 'true'"
label="Verification code" label="Verification code"
ng-model="$ctrl.code" ng-model="$ctrl.code"
vn-name="code" vn-name="code"

View File

@ -15,6 +15,10 @@ export default class Controller {
} }
$onInit() { $onInit() {
this.oldPassword = 'nightmare';
this.repeatPassword = 'test.1234';
this.newPassword = 'test.1234';
this.verificationCode = '1234';
if (!this.$state.params.id) if (!this.$state.params.id)
this.$state.go('login'); this.$state.go('login');

View File

@ -1,6 +1,6 @@
const {models} = require('vn-loopback/server/server'); const {models} = require('vn-loopback/server/server');
fdescribe('account changePassword()', () => { describe('account changePassword()', () => {
const ctx = {req: {accessToken: {userId: 70}}}; const ctx = {req: {accessToken: {userId: 70}}};
const unauthCtx = { const unauthCtx = {
req: { req: {

View File

@ -37,6 +37,13 @@
"principalType": "ROLE", "principalType": "ROLE",
"principalId": "$authenticated", "principalId": "$authenticated",
"permission": "ALLOW" "permission": "ALLOW"
},
{
"property": "changePassword",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
} }
] ]
} }