-
Notifications
You must be signed in to change notification settings - Fork 6
/
roles.js
35 lines (31 loc) · 900 Bytes
/
roles.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// server/roles.js
const AccessControl = require("accesscontrol");
const ac = new AccessControl();
exports.roles = (function() {
ac.grant("public")
.readAny("article")
.createAny('submit_project')
ac.grant("teamMember")
.readOwn("profile")
.createOwn('profile')
.updateOwn("profile")
.updateAny("article")
.createAny("article")
.readAny("article")
.deleteAny('article')
.createAny('submit_project')
ac.grant("admin")
.extend('teamMember')
.readAny("profile")
.createAny('profile')
.updateAny("profile")
.deleteAny('profile')
.createAny('certificate')
.readAny('certificate')
.readAny('submit_project')
.createAny('project')
.updateAny('project')
.readAny('project')
.deleteAny('project')
return ac;
})();