refs #5468 scope para VnUser
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-04-27 15:06:05 +02:00
parent 1597f7ab69
commit 87ffd2668e
3 changed files with 18 additions and 5 deletions

View File

@ -121,5 +121,10 @@
"principalId": "$authenticated",
"permission": "ALLOW"
}
]
],
"scopes": {
"preview": {
"fields": ["id", "name", "username", "roleFk", "nickname", "lang", "active", "created", "updated", "image", "hasGrant", "realm"]
}
}
}

View File

@ -5,6 +5,7 @@ import './style.scss';
class Controller extends ModuleCard {
reload() {
const filter = {
where: {id: this.$params.id},
include: {
relation: 'role',
scope: {
@ -14,8 +15,11 @@ class Controller extends ModuleCard {
};
return Promise.all([
this.$http.get(`VnUsers/${this.$params.id}`, {filter})
.then(res => this.user = res.data),
this.$http.get(`VnUsers/preview`, {filter})
.then(res => {
const [user] = res.data;
this.user = user;
}),
this.$http.get(`Accounts/${this.$params.id}/exists`)
.then(res => this.hasAccount = res.data.exists)
]);

View File

@ -8,6 +8,7 @@ class Controller extends Summary {
if (!value) return;
const filter = {
where: {id: value.id},
include: {
relation: 'role',
scope: {
@ -15,8 +16,11 @@ class Controller extends Summary {
}
}
};
this.$http.get(`VnUsers/${value.id}`, {filter})
.then(res => this.$.summary = res.data);
this.$http.get(`VnUsers/preview`, {filter})
.then(res => {
const [summary] = res.data;
this.$.summary = summary;
});
}
get isHr() {
return this.aclService.hasAny(['hr']);