feat: refs #6938 add scope & acls
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-04-15 10:21:59 +02:00
parent 40473d0cc9
commit a68b8431c5
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,4 @@
UPDATE salix.ACL SET principalId = "hr" WHERE property IN ('find','findById','findOne') AND model = "Worker";
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES ('Worker', 'summary', 'READ', 'ALLOW', 'ROLE', 'employee');

View File

@ -92,5 +92,58 @@
"model": "WorkerTeamCollegues",
"foreignKey": "workerFk"
}
},
"scopes":{
"summary": {
"fields": [
[
"id",
"firstName",
"lastName",
"bossFk",
"maritalStatus",
"originCountryFk",
"educationLevelFk",
"SSN",
"mobileExtension",
"code",
"locker",
"fi",
"birth",
"isF11Allowed"
]
],
"include": [
{
"relation": "user",
"scope": {
"fields": ["email", "name", "nickname", "roleFk"],
"include": {
"relation": "role",
"scope": {
"fields": ["name"]
}
}
}
}, {
"relation": "department",
"scope": {
"include": {
"relation": "department",
"scope": {
"fields": ["name"]
}
}
}
}, {
"relation": "boss"
}, {
"relation": "client"
}, {
"relation": "sip"
}
]
}
}
}