feat; refs #5919 WIP acls
This commit is contained in:
parent
d0c9e83504
commit
26ff5e8fa9
|
@ -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');
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "Locker",
|
||||
"base": "VnModel",
|
||||
"description": "Employee's locker",
|
||||
"description": "Worker's locker",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "locker"
|
||||
|
@ -14,5 +14,17 @@
|
|||
"gender": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"user": {
|
||||
"type": "belongsTo",
|
||||
"model": "VnUser",
|
||||
"foreignKey": "workerFk"
|
||||
}
|
||||
},
|
||||
"scopes": {
|
||||
"codes": {
|
||||
"fields": ["id","code"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,5 +97,23 @@
|
|||
"model": "Locker",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue