-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEdocsPolicy
More file actions
45 lines (42 loc) · 2.12 KB
/
EdocsPolicy
File metadata and controls
45 lines (42 loc) · 2.12 KB
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
36
37
38
39
40
41
42
43
44
45
subject.organization_id = SimpleAttribute(String)
subject.department = SimpleAttribute(String)
subject.assigned_organizations = ListAttribute(String)
subject.role = SimpleAttribute(String)
subject.supervisees = ListAttribute(String)
resource.creator = SimpleAttribute(String)
resource.origin = SimpleAttribute(String)
resource.destination = SimpleAttribute(String)
resource.type = SimpleAttribute(String)
resource.destination_organization = SimpleAttribute(String)
resource.confidential = SimpleAttribute(Number)
action.id = SimpleAttribute(String)
Policy("Docs Policy") := when (action.id === "view") apply FirstApplicable to (
Policy("admin") := when (subject.role === "admin") apply FirstApplicable to (
Policy("not sensitive") := when (resource.confidential gt 5) apply PermitOverrides to (
Rule("default deny") := deny
),
Rule("not org1") := deny iff (resource.origin === "1"),
Rule("permit") := permit
),
Policy("manager") := when (subject.role === "manager") apply PermitOverrides to (
Rule("creator") := permit iff (resource.creator === subject.id),
Rule("addressed") := permit iff (resource.destination === subject.id),
Rule("addressed organization") := permit iff (resource.destination_organization === subject.organization_id),
Rule("addressed organization is assigned") := permit iff (resource.destination_organization in subject.assigned_organizations),
Rule("supervised creator") := permit iff (resource.creator in subject.supervisees),
Rule("deny") := deny
),
Policy("employee") := when (subject.role === "employee") apply FirstApplicable to (
Policy("not sensitive") := when ((resource.confidential gteq 1)) apply PermitOverrides to (
Rule("default deny") := deny
),
Policy("department") := when (subject.department === "accounting") apply DenyOverrides to (
Rule("no contracts") := deny iff (resource.type === "contract"),
Rule("permit") := permit
),
Rule("creator") := permit iff (resource.creator === subject.id),
Rule("addressed") := permit iff (resource.destination === subject.id),
Rule("deny") := deny
),
Rule("deny") := deny
)