Merge pull request 'feat: refs #7323 use scopes' (!2993) from 7323-hotfix-advancedSummary into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2993
Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-09-19 10:08:56 +00:00
commit b6027d3724
2 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,4 @@
UPDATE salix.ACL SET principalId = 'employee' WHERE model = 'Worker' AND principalId = '$subordinate';
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES ('Worker', '__get__advancedSummary', 'READ', 'ALLOW', 'ROLE', 'hr'),
('Worker', '__get__summary', 'READ', 'ALLOW', 'ROLE', 'employee');

View File

@ -193,6 +193,74 @@
}
}
]
},
"summary": {
"include": [
{
"relation": "user",
"scope": {
"fields": [
"name",
"nickname",
"roleFk"
],
"include": [
{
"relation": "role",
"scope": {
"fields": [
"name"
]
}
},
{
"relation": "emailUser",
"scope": {
"fields": [
"email"
]
}
}
]
}
},
{
"relation": "department",
"scope": {
"include": {
"relation": "department",
"scope": {
"fields": [
"name"
]
}
}
}
},
{
"relation": "boss"
},
{
"relation": "client"
},
{
"relation": "sip"
}
]
},
"advancedSummary": {
"fields": [
"id",
"fiDueDate",
"sex",
"seniority",
"fi",
"isFreelance",
"isSsDiscounted",
"hasMachineryAuthorized",
"isDisable",
"birth"
]
}
}
}