feat: refs #7119 update ACLs and remove unused models for vehicle management
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
ecedc84164
commit
946d08e543
|
@ -2,4 +2,6 @@ INSERT INTO salix.ACL (model, property, accessType, permission, principalType, p
|
|||
VALUES ('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'delivery'),
|
||||
('Vehicle', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'delivery'),
|
||||
('BankPolicy', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery'),
|
||||
('VehicleState', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery' ),
|
||||
('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery' ),
|
||||
('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss');
|
|
@ -92,9 +92,9 @@ module.exports = Self => {
|
|||
case 'vehicleStateFk':
|
||||
return {vehicleStateFk: value};
|
||||
}
|
||||
});
|
||||
}) || {};
|
||||
|
||||
const myFilter = mergeFilters(filter, {where});
|
||||
const myFilter = mergeFilters(filter, {where: {...where, isActive: true}});
|
||||
|
||||
const stmt = new ParameterizedSQL(`
|
||||
SELECT v.id,
|
||||
|
@ -122,16 +122,14 @@ module.exports = Self => {
|
|||
FROM vehicleEvent e
|
||||
LEFT JOIN vehicleState s ON e.vehicleStateFk = s.id
|
||||
) sub ON sub.vehicleFk = v.id AND sub.rn = 1
|
||||
`
|
||||
);
|
||||
`);
|
||||
|
||||
const sqlWhere = conn.makeWhere(myFilter.where);
|
||||
stmt.merge(sqlWhere);
|
||||
stmt.merge(conn.makePagination(myFilter));
|
||||
|
||||
const sql = ParameterizedSQL.join([stmt], ';');
|
||||
const result = await conn.executeStmt(sql, myOptions);
|
||||
|
||||
return result;
|
||||
return conn.executeStmt(sql, myOptions);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -44,12 +44,6 @@
|
|||
"Vehicle": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"VehicleEvent": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"VehicleNotes": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"VehicleState": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "employee",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -11,13 +11,5 @@
|
|||
"type": "number",
|
||||
"id": true
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "delivery",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
{
|
||||
"name": "VehicleEvent",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "vehicleEvent"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true
|
||||
},
|
||||
"started": {
|
||||
"type": "date"
|
||||
},
|
||||
"finished": {
|
||||
"type": "date"
|
||||
},
|
||||
"vehicleStateFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"vehicleFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"userFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"notified": {
|
||||
"type": "date"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"state": {
|
||||
"type": "belongsTo",
|
||||
"model": "VehicleState",
|
||||
"foreignKey": "vehicleStateFk"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"name": "VehicleNotes",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "vehicleNotes"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true
|
||||
},
|
||||
"vehicleFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"note": {
|
||||
"type": "string"
|
||||
},
|
||||
"userFk": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "delivery",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -17,13 +17,5 @@
|
|||
"hasToNotify": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue