-
Notifications
You must be signed in to change notification settings - Fork 4
/
sweets.cedar
52 lines (45 loc) · 1.04 KB
/
sweets.cedar
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
46
47
48
49
50
51
52
@id("owner-policy")
permit(principal, action, resource)
when { principal == resource.owner };
@id("admin-role-policy")
permit (
principal in BoxRole::"admin",
action,
resource
);
@id("mike-edit-box-1")
permit (
principal == User::"Mike",
action == Action::"update",
resource == Box::"1"
);
@id("mike-view-box-2")
permit (
principal == User::"Mike",
action == Action::"read",
resource == Box::"2"
);
@id("eric-view-box-9")
permit (
principal == User::"Eric",
action == Action::"read",
resource == Box::"9"
);
@id("eric-edit-box-10")
permit (
principal == User::"Eric",
action == Action::"update",
resource == Box::"10"
);
@id("manager-view-edit-boxcollection-giftset")
permit (
principal in BoxRole::"manager",
action in [Action::"read", Action::"update"],
resource in BoxCollection::"giftSet"
);
@id("sales-view-edit-boxgroup-christmasGiftSet")
permit (
principal in BoxRole::"sales",
action in [Action::"read", Action::"update"],
resource in BoxGroup::"christmasGiftSet"
);