refs #5468 a la seccion privileges se le pasa el parametro user
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-05-11 15:25:37 +02:00
parent 74ea0ce9fd
commit b10f90fbe1
5 changed files with 39 additions and 6 deletions

View File

@ -1,7 +1,5 @@
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('VnUser', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('VnUser', '*', 'WRITE', 'ALLOW', 'ROLE', 'sysadmin'),
('VnUser','acl','READ','ALLOW','ROLE','account'),
('VnUser','getCurrentUserData','READ','ALLOW','ROLE','account'),
('VnUser','changePassword', 'WRITE', 'ALLOW', 'ROLE', 'account'),

View File

@ -4,5 +4,6 @@ DELETE
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('VnUser', '*', '*', 'ALLOW', 'ROLE', 'itManagement'),
('VnUser', '__get__preview', 'READ', 'ALLOW', 'ROLE', 'employee'),
('VnUser', 'preview', '*', 'ALLOW', 'ROLE', 'employee');

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,40 @@
import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {}
export default class Controller extends Section {
set user(value) {
this._user = value;
this.$.summary = null;
if (!value) return;
const filter = {
where: {id: value.id},
include: {
relation: 'role',
scope: {
fields: ['id', 'name']
}
}
};
this.$http.get(`VnUsers/preview`, {filter})
.then(res => {
const [summary] = res.data;
this.$.summary = summary;
});
}
get isHr() {
return this.aclService.hasAny(['hr']);
}
get user() {
return this._user;
}
}
ngModule.component('vnUserPrivileges', {
template: require('./index.html'),
controller: Controller
controller: Controller,
bindings: {
user: '<'
}
});

View File

@ -115,7 +115,10 @@
"url": "/privileges",
"state": "account.card.privileges",
"component": "vn-user-privileges",
"description": "Privileges"
"description": "Privileges",
"params": {
"user": "$ctrl.user"
}
},
{
"url": "/role?q",