blob: 4e809bb09da6cf16f721daa3a56fc3108ff2df97 (
plain)
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
53
54
55
56
57
58
59
60
61
|
# Policy
A policy is a predicate that describes if a subject can perform an action
against a specific resource.
```ruby
policy(:parent) { predicate }
policy(:partner) { predicate }
policy(:sibling) { predicate }
policy(:child) { predicate }
enable(:permission, on: resource).when { parent | partner }
```
Authorizaion uses policies to determine if a subject in a specific context is
authorized to perform an action against a resource.
```ruby
def can?(subject, action, resource)
end
```
* [Zanzibar](./ZANZIBAR.md)
## Policy Language
A policy language facilitates:
1. the specification of composite policies, which in turn forms the basis of trust delegation.
1. **the static analysis of policies and system configuration.**
## Security Context/Scope
1. Single resource
1. Nested resources
1. Individual Attributes on a resource
## Example
The following hierarchy will be used as the basis for expression policy.
```ruby
class Organization
has_many :groups
end
class Group
belongs_to :organization
has_many :projects
end
class Project
belongs_to :group
has_many :issues
end
class Issue
end
```
[Social Network Graph](./sns.dot.png)
|