-
Notifications
You must be signed in to change notification settings - Fork 10
/
scope.go
60 lines (48 loc) · 1.99 KB
/
scope.go
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
package ast
import (
"github.com/cedar-policy/cedar-go/types"
)
// PrincipalEq replaces the principal scope condition.
func (p *Policy) PrincipalEq(entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().PrincipalEq(entity))
}
// PrincipalIn replaces the principal scope condition.
func (p *Policy) PrincipalIn(entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().PrincipalIn(entity))
}
// PrincipalIs replaces the principal scope condition.
func (p *Policy) PrincipalIs(entityType types.EntityType) *Policy {
return wrapPolicy(p.unwrap().PrincipalIs(entityType))
}
// PrincipalIsIn replaces the principal scope condition.
func (p *Policy) PrincipalIsIn(entityType types.EntityType, entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().PrincipalIsIn(entityType, entity))
}
// ActionEq replaces the action scope condition.
func (p *Policy) ActionEq(entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().ActionEq(entity))
}
// ActionIn replaces the action scope condition.
func (p *Policy) ActionIn(entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().ActionIn(entity))
}
// ActionInSet replaces the action scope condition.
func (p *Policy) ActionInSet(entities ...types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().ActionInSet(entities...))
}
// ResourceEq replaces the resource scope condition.
func (p *Policy) ResourceEq(entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().ResourceEq(entity))
}
// ResourceIn replaces the resource scope condition.
func (p *Policy) ResourceIn(entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().ResourceIn(entity))
}
// ResourceIs replaces the resource scope condition.
func (p *Policy) ResourceIs(entityType types.EntityType) *Policy {
return wrapPolicy(p.unwrap().ResourceIs(entityType))
}
// ResourceIsIn replaces the resource scope condition.
func (p *Policy) ResourceIsIn(entityType types.EntityType, entity types.EntityUID) *Policy {
return wrapPolicy(p.unwrap().ResourceIsIn(entityType, entity))
}