@ozdao/prometheus-framework 0.2.126 → 0.2.128
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +54 -2
- package/dist/auth.server.mjs +54 -2
- package/dist/gallery.server.js +55 -3
- package/dist/gallery.server.mjs +55 -3
- package/dist/main-CF35oB7q.js +92 -0
- package/dist/main-CmL_j3wv.mjs +14223 -0
- package/dist/organizations.server.js +112 -184
- package/dist/organizations.server.mjs +112 -184
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -94
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +94 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -77
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +57 -50
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +68 -62
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.js +4 -4
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +116 -94
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +9 -4
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-BDaOF322.js +1 -0
- package/dist/web-DtWmpLE-.mjs +54 -0
- package/package.json +1 -1
- package/src/modules/auth/controllers/auth.controller.js +54 -2
- package/src/modules/auth/routes/auth.routes.js +8 -1
- package/src/modules/auth/store/auth.js +21 -9
- package/src/modules/backoffice/components/pages/Dashboard.vue +6 -0
- package/src/modules/gallery/gallery.client.js +1 -1
- package/src/modules/gallery/routes/gallery.routes.js +7 -3
- package/src/modules/globals/mixins/mixins.js +17 -0
- package/src/modules/middlewares/server/verifyAccesses.js +100 -23
- package/src/modules/organizations/components/blocks/CardDepartment.vue +1 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +24 -2
- package/src/modules/organizations/components/pages/Members.vue +1 -1
- package/src/modules/organizations/models/department.model.js +42 -2
- package/src/modules/organizations/routes/departments.routes.js +1 -8
- package/src/modules/organizations/store/departments.js +5 -0
@@ -2,32 +2,36 @@
|
|
2
2
|
const controllerFactory = require("../controllers/gallery.controller");
|
3
3
|
// Middlewares
|
4
4
|
const middlewareFactoryGlobal = require('@pf/src/modules/middlewares/server');
|
5
|
+
const middlewareFactoryAccesses = require('@pf/src/modules/middlewares/server/verifyAccesses')
|
5
6
|
|
6
7
|
module.exports = function(app, db, origins) {
|
7
8
|
const controller = controllerFactory(db);
|
8
9
|
|
9
10
|
const { authJwt } = middlewareFactoryGlobal(db);
|
11
|
+
const { verifyRead } = middlewareFactoryAccesses(db)
|
12
|
+
|
10
13
|
|
11
14
|
app.get(
|
12
15
|
"/api/gallery/read",
|
16
|
+
[
|
17
|
+
authJwt.verifyToken,
|
18
|
+
verifyRead('gallery'),
|
19
|
+
],
|
13
20
|
controller.read
|
14
21
|
);
|
15
22
|
|
16
23
|
app.post(
|
17
24
|
"/api/gallery/create",
|
18
|
-
[authJwt.verifyToken],
|
19
25
|
controller.create
|
20
26
|
);
|
21
27
|
|
22
28
|
app.put(
|
23
29
|
"/api/gallery/update",
|
24
|
-
[authJwt.verifyToken],
|
25
30
|
controller.update
|
26
31
|
);
|
27
32
|
|
28
33
|
app.delete(
|
29
34
|
"/api/gallery/delete/:_id",
|
30
|
-
[authJwt.verifyToken],
|
31
35
|
controller.delete
|
32
36
|
);
|
33
37
|
};
|
@@ -1,6 +1,23 @@
|
|
1
1
|
// mixins.js
|
2
2
|
export const globalMixins = {
|
3
3
|
methods: {
|
4
|
+
hasAccess(organizationId, rightCategory, rightType, accesses) {
|
5
|
+
const accessArray = accesses;
|
6
|
+
|
7
|
+
const organizationAccess = accessArray.find(access => access.organization === organizationId);
|
8
|
+
|
9
|
+
if (!organizationAccess) {
|
10
|
+
return false;
|
11
|
+
}
|
12
|
+
|
13
|
+
const categoryAccess = organizationAccess.rights[rightCategory];
|
14
|
+
|
15
|
+
if (!categoryAccess) {
|
16
|
+
return false;
|
17
|
+
}
|
18
|
+
|
19
|
+
return categoryAccess[rightType] === true;
|
20
|
+
},
|
4
21
|
returnCurrency() {
|
5
22
|
const currency = '฿'
|
6
23
|
return currency
|
@@ -1,33 +1,110 @@
|
|
1
|
-
const
|
1
|
+
const middlewareFactory = (db) => {
|
2
|
+
const User = db.user;
|
3
|
+
const Organization = db.organization;
|
4
|
+
const Department = db.department;
|
2
5
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
+
const verifyRead = (resource) => {
|
7
|
+
return async (req, res, next) => {
|
8
|
+
try {
|
9
|
+
// Получаем идентификатор организации из запроса
|
10
|
+
const ownerOrgId = new db.mongoose.Types.ObjectId(req.query.owner);;
|
6
11
|
|
7
|
-
|
8
|
-
|
9
|
-
ReadDepartments,
|
10
|
-
];
|
12
|
+
// Получаем текущего пользователя
|
13
|
+
const userId = new db.mongoose.Types.ObjectId(req.userId);
|
11
14
|
|
12
|
-
|
15
|
+
// Проверяем, является ли пользователь владельцем организации
|
16
|
+
const isOwnerOfOrg = await Organization.exists({
|
17
|
+
_id: ownerOrgId,
|
18
|
+
owner: userId
|
19
|
+
});
|
13
20
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
21
|
+
// Если пользователь является владельцем организации, ему разрешен доступ ко всем ресурсам
|
22
|
+
if (isOwnerOfOrg) {
|
23
|
+
return next();
|
24
|
+
}
|
18
25
|
|
19
|
-
|
20
|
-
|
26
|
+
// Проверяем, является ли пользователь членом организации через департаменты
|
27
|
+
const isMemberOfOrg = await Department.exists({
|
28
|
+
organization: ownerOrgId,
|
29
|
+
'members.user': userId
|
30
|
+
});
|
21
31
|
|
22
|
-
// Добавляем звено следующего посредника
|
23
|
-
middleware.next = nextMiddleware;
|
24
32
|
|
25
|
-
|
26
|
-
|
33
|
+
if (!isMemberOfOrg) {
|
34
|
+
// Если пользователь не является членом организации, ограничиваем доступ к опубликованным ресурсам
|
35
|
+
req.query.status = 'published';
|
36
|
+
} else {
|
37
|
+
// Пользователь является членом организации, проверяем его права доступа
|
27
38
|
|
28
|
-
|
29
|
-
|
39
|
+
// Находим все департаменты данной организации, к которым относится пользователь
|
40
|
+
const departments = await Department.find({ organization: ownerOrgId });
|
30
41
|
|
31
|
-
|
32
|
-
|
42
|
+
// Проверяем доступ пользователя ко всем ресурсам
|
43
|
+
let hasAccess = false;
|
44
|
+
|
45
|
+
for (const department of departments) {
|
46
|
+
const accessRights = department.accesses[resource];
|
47
|
+
if (accessRights && accessRights.read) {
|
48
|
+
// Если хотя бы в одном департаменте есть права на чтение ресурса, разрешаем доступ
|
49
|
+
hasAccess = true;
|
50
|
+
break;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
if (!hasAccess) {
|
55
|
+
// Если у пользователя нет прав на чтение данного ресурса ни в одном департаменте, ограничиваем доступ к опубликованным ресурсам
|
56
|
+
req.query.status = 'published';
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
next();
|
61
|
+
} catch (err) {
|
62
|
+
console.error('Access control error:', err);
|
63
|
+
return res.status(403).json({ error: 'Access denied' });
|
64
|
+
}
|
65
|
+
};
|
66
|
+
};
|
67
|
+
|
68
|
+
// Middleware для проверки доступа
|
69
|
+
const verifyModify = (action, resource) => {
|
70
|
+
return async (req, res, next) => {
|
71
|
+
try {
|
72
|
+
const user = req.userId;
|
73
|
+
|
74
|
+
const department = await Department.findOne({
|
75
|
+
owner: organizationId
|
76
|
+
});
|
77
|
+
|
78
|
+
if (!department) {
|
79
|
+
return res.status(403).json({
|
80
|
+
message: "Access forbidden"
|
81
|
+
});
|
82
|
+
}
|
83
|
+
|
84
|
+
const accesses = department.accesses;
|
85
|
+
|
86
|
+
// Проверяем права доступа пользователя к ресурсу
|
87
|
+
const resourceAccess = accesses[resource];
|
88
|
+
if (!resourceAccess || !resourceAccess[action]) {
|
89
|
+
return res.status(403).json({
|
90
|
+
message: "Access forbidden"
|
91
|
+
});
|
92
|
+
}
|
93
|
+
|
94
|
+
next();
|
95
|
+
} catch (error) {
|
96
|
+
console.error("Access control error:", error);
|
97
|
+
return res.status(500).json({
|
98
|
+
message: "Internal server error"
|
99
|
+
});
|
100
|
+
}
|
101
|
+
};
|
102
|
+
};
|
103
|
+
|
104
|
+
|
105
|
+
return {
|
106
|
+
verifyRead,
|
107
|
+
};
|
33
108
|
};
|
109
|
+
|
110
|
+
module.exports = middlewareFactory;
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<ul>
|
33
33
|
<li v-if="department.members.length < 1">No members in department</li>
|
34
34
|
<User
|
35
|
-
class="pd-small br-solid br-1px br-black-transp-5 radius-small mn-b-thin"
|
35
|
+
class="h-4r pd-small br-solid br-1px br-black-transp-5 radius-small mn-b-thin"
|
36
36
|
v-for="(member, index) in department.members"
|
37
37
|
:key="index"
|
38
38
|
:user="member.user"
|
@@ -54,7 +54,7 @@
|
|
54
54
|
class="cols-1 gap-thin mn-b-thin"
|
55
55
|
>
|
56
56
|
<CardUser
|
57
|
-
class="bg-white pd-thin radius-medium w-100"
|
57
|
+
class="h-4r bg-white pd-thin radius-medium w-100"
|
58
58
|
v-for="(member, index) in departments.state.department.members"
|
59
59
|
:key="index"
|
60
60
|
:user="member.user"
|
@@ -110,7 +110,7 @@
|
|
110
110
|
globals.actions.add(departments.state.department.members, { _id: user.user._id, user: user.user, position: 'Member'})
|
111
111
|
closeMemberPopup();
|
112
112
|
}"
|
113
|
-
class="bg-white pd-thin radius-medium w-100 mn-b-thin"
|
113
|
+
class="h-4r bg-white pd-thin radius-medium w-100 mn-b-thin"
|
114
114
|
/>
|
115
115
|
</Feed>
|
116
116
|
</Popup>
|
@@ -139,6 +139,28 @@
|
|
139
139
|
<p class="p-medium mn-b-small">Please select organization accesses for user in department:</p>
|
140
140
|
|
141
141
|
<div class="cols-1 gap-thin">
|
142
|
+
<h4>Gallery</h4>
|
143
|
+
<Checkbox
|
144
|
+
label="Read gallery"
|
145
|
+
name="readProducts"
|
146
|
+
class="w-100 mn-r-small bg-white radius-small pd-small"
|
147
|
+
:radio="departments.state.department.accesses.gallery.read"
|
148
|
+
@update:radio="updated => (departments.state.department.accesses.gallery.read = !departments.state.department.accesses.gallery.read)"
|
149
|
+
/>
|
150
|
+
<Checkbox
|
151
|
+
label="Edit gallery"
|
152
|
+
name="editProducts"
|
153
|
+
class="w-100 mn-r-small bg-white radius-small pd-small"
|
154
|
+
:radio="departments.state.department.accesses.gallery.edit"
|
155
|
+
@update:radio="updated => (departments.state.department.accesses.gallery.edit = !departments.state.department.accesses.gallery.edit)"
|
156
|
+
/>
|
157
|
+
<Checkbox
|
158
|
+
label="Delete gallery"
|
159
|
+
name="deleteProducts"
|
160
|
+
class="w-100 bg-white radius-small pd-small"
|
161
|
+
:radio="departments.state.department.accesses.gallery.delete"
|
162
|
+
@update:radio="updated => (departments.state.department.accesses.gallery.delete = !departments.state.department.accesses.gallery.delete)"
|
163
|
+
/>
|
142
164
|
<h4>Products</h4>
|
143
165
|
<Checkbox
|
144
166
|
label="Read products"
|
@@ -28,6 +28,48 @@ module.exports = (mongoose) => {
|
|
28
28
|
},
|
29
29
|
|
30
30
|
accesses: {
|
31
|
+
members: {
|
32
|
+
read: {
|
33
|
+
type: Boolean,
|
34
|
+
default: false,
|
35
|
+
},
|
36
|
+
edit: {
|
37
|
+
type: Boolean,
|
38
|
+
default: false,
|
39
|
+
},
|
40
|
+
delete: {
|
41
|
+
type: Boolean,
|
42
|
+
default: false,
|
43
|
+
},
|
44
|
+
},
|
45
|
+
gallery: {
|
46
|
+
read: {
|
47
|
+
type: Boolean,
|
48
|
+
default: false,
|
49
|
+
},
|
50
|
+
edit: {
|
51
|
+
type: Boolean,
|
52
|
+
default: false,
|
53
|
+
},
|
54
|
+
delete: {
|
55
|
+
type: Boolean,
|
56
|
+
default: false,
|
57
|
+
},
|
58
|
+
},
|
59
|
+
leftovers: {
|
60
|
+
read: {
|
61
|
+
type: Boolean,
|
62
|
+
default: false,
|
63
|
+
},
|
64
|
+
edit: {
|
65
|
+
type: Boolean,
|
66
|
+
default: false,
|
67
|
+
},
|
68
|
+
delete: {
|
69
|
+
type: Boolean,
|
70
|
+
default: false,
|
71
|
+
},
|
72
|
+
},
|
31
73
|
products: {
|
32
74
|
read: {
|
33
75
|
type: Boolean,
|
@@ -42,7 +84,6 @@ module.exports = (mongoose) => {
|
|
42
84
|
default: false,
|
43
85
|
},
|
44
86
|
},
|
45
|
-
|
46
87
|
orders: {
|
47
88
|
read: {
|
48
89
|
type: Boolean,
|
@@ -57,7 +98,6 @@ module.exports = (mongoose) => {
|
|
57
98
|
default: false,
|
58
99
|
},
|
59
100
|
},
|
60
|
-
|
61
101
|
departments: {
|
62
102
|
read: {
|
63
103
|
type: Boolean,
|
@@ -1,19 +1,12 @@
|
|
1
1
|
// Factories
|
2
2
|
const controllerFactory = require("../controllers/departments.controller")
|
3
|
-
// Middlewares
|
4
|
-
const accessMiddlewaresFactory = require('@pf/src/modules/middlewares/server/verifyAccesses')
|
5
|
-
|
6
3
|
// Routes
|
7
4
|
module.exports = function(app, db) {
|
8
5
|
const controller = controllerFactory(db)
|
9
|
-
|
10
|
-
|
6
|
+
|
11
7
|
// Get organization departments by _id
|
12
8
|
app.get(
|
13
9
|
"/api/departments/read",
|
14
|
-
// [
|
15
|
-
// verifyAccesses('read', 'departments'),
|
16
|
-
// ],
|
17
10
|
controller.read
|
18
11
|
);
|
19
12
|
|