feat: refs #7119 update ACLs for vehicle management and refine vehicle filter logic
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
946d08e543
commit
3d2a7cfb66
|
@ -1,7 +1,10 @@
|
||||||
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
|
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
|
||||||
VALUES ('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'delivery'),
|
VALUES ('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||||
('Vehicle', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'delivery'),
|
('Vehicle', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||||
('BankPolicy', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery'),
|
('Vehicle', 'findById', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||||
('VehicleState', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery' ),
|
('Vehicle', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
||||||
('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery' ),
|
('BankPolicy', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||||
('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss');
|
('VehicleState', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative' ),
|
||||||
|
('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative' ),
|
||||||
|
('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
||||||
|
('Vehicle', '__get__active', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -94,7 +94,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
}) || {};
|
}) || {};
|
||||||
|
|
||||||
const myFilter = mergeFilters(filter, {where: {...where, isActive: true}});
|
const myFilter = mergeFilters(filter, {where});
|
||||||
|
|
||||||
const stmt = new ParameterizedSQL(`
|
const stmt = new ParameterizedSQL(`
|
||||||
SELECT v.id,
|
SELECT v.id,
|
||||||
|
|
|
@ -104,19 +104,17 @@
|
||||||
"property": "ppeFk"
|
"property": "ppeFk"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scope": {
|
"scopes": {
|
||||||
"where": {
|
"active": {
|
||||||
"isActive": {
|
"fields": [
|
||||||
"neq": false
|
"id",
|
||||||
|
"numberPlate"
|
||||||
|
],
|
||||||
|
"where": {
|
||||||
|
"isActive": {
|
||||||
|
"neq": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"acls": [
|
|
||||||
{
|
|
||||||
"accessType": "READ",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "ALLOW"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue