#5919 createLocker #2446

Merged
jorgep merged 42 commits from 5919-createLocker into dev 2024-05-13 13:10:40 +00:00
3 changed files with 39 additions and 2 deletions
Showing only changes of commit 26ff5e8fa9 - Show all commits

View File

@ -0,0 +1,7 @@
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES ('Locker', '__get__codes', 'READ', 'ALLOW', 'ROLE', 'employee'),
('Locker', '*', '*', 'ALLOW', 'ROLE', 'hr'),
('Locker', '*', '*', 'ALLOW', 'ROLE', 'productionBoss'),
('Worker', '__get__locker', 'READ', 'ALLOW', 'ROLE', 'hr'),
('Worker', '__get__locker', 'READ', 'ALLOW', 'ROLE', 'productionBoss'),
('Worker', '__get__locker', 'READ', 'ALLOW', 'ROLE', 'productionBoss');

View File

@ -1,7 +1,7 @@
{ {
"name": "Locker", "name": "Locker",
"base": "VnModel", "base": "VnModel",
"description": "Employee's locker", "description": "Worker's locker",
"options": { "options": {
"mysql": { "mysql": {
"table": "locker" "table": "locker"
@ -14,5 +14,17 @@
"gender": { "gender": {
"type": "string" "type": "string"
} }
},
"relations": {
"user": {
"type": "belongsTo",
"model": "VnUser",
"foreignKey": "workerFk"
}
},
"scopes": {
"codes": {
"fields": ["id","code"]
}
} }
} }

View File

@ -97,5 +97,23 @@
"model": "Locker", "model": "Locker",
"foreignKey": "workerFk" "foreignKey": "workerFk"
} }
},
"scopes":{
"locker": {
"fields":["id","sex"],
"include": {
"relation": "locker",
"scope": {"fields": ["id", "code"]}
} }
} }
},
"acls":[
{
"property": "__get__locker",
"accessType": "READ",
"permission": "ALLOW",
"principalType": "ROLE",
"principalId": "$owner"
}
]
}