salix/modules/account/front/privileges/index.js

41 lines
934 B
JavaScript
Raw Normal View History

import ngModule from '../module';
import Section from 'salix/components/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,
bindings: {
user: '<'
}
});