@openinc/parse-server-opendash 3.23.3 → 3.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,6 +8,19 @@ async function init() {
|
|
|
8
8
|
const { object, original, user } = request;
|
|
9
9
|
await (0, __1.defaultHandler)(request);
|
|
10
10
|
await (0, __1.defaultAclHandler)(request);
|
|
11
|
+
const assignedRoles = await object
|
|
12
|
+
.relation("assignedRoles")
|
|
13
|
+
.query()
|
|
14
|
+
.find({ useMasterKey: true });
|
|
15
|
+
const assignedUsers = await object
|
|
16
|
+
.relation("assignedUsers")
|
|
17
|
+
.query()
|
|
18
|
+
.find({ useMasterKey: true });
|
|
19
|
+
// Ensure that the project's ACL allows assigned users and roles to read the project
|
|
20
|
+
const acl = object.getACL();
|
|
21
|
+
assignedRoles.forEach((role) => acl?.setRoleReadAccess(role.id, true));
|
|
22
|
+
assignedUsers.forEach((user) => acl?.setReadAccess(user.id, true));
|
|
23
|
+
object.setACL(acl);
|
|
11
24
|
// TODO
|
|
12
25
|
});
|
|
13
26
|
(0, __1.afterSaveHook)(types_1.Maintenance_Project, async (request) => {
|