function setCustomAttribute(ctx, api) {
const user = ctx.v1.getUser()
if (ctx.v1.user.grants == undefined || ctx.v1.user.grants.count == 0) {
return;
}
let roles = [];
ctx.v1.user.grants.grants.forEach(grant => {
grant.roles.forEach(role => {
roles.push(role)
})
})
api.v1.attributes.setCustomAttribute('Roles', '', ...roles)
}
function setCustomAttribute(ctx, api) {
const user = ctx.v1.getUser()
if (ctx.v1.user.grants == undefined || ctx.v1.user.grants.count == 0) {
return;
}
let roles = [];
ctx.v1.user.grants.grants.forEach(grant => {
grant.roles.forEach(role => {
roles.push(role)
})
})
api.v1.attributes.setCustomAttribute('Roles', '', ...roles)
}