-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaccess_request.go
24 lines (22 loc) · 960 Bytes
/
access_request.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
package restrict
// Context - alias type for a map of any values.
type Context map[string]interface{}
// AccessRequest - describes a Subject's intention to perform some Actions against
// given Resource.
type AccessRequest struct {
// Subject - subject (typically a user) that wants to perform given Actions.
// Needs to implement Subject interface.
Subject Subject
// Resource - resource that given Subject wants to interact with.
// Needs to implement Resource interface.
Resource Resource
// Actions - list of operations Subject wants to perform on given Resource.
Actions []string
// Context - map of any additional values needed while checking the access.
Context Context
// SkipConditions - allows to skip Conditions while checking the access.
SkipConditions bool
// CompleteValidation - when true, validation will not return early, and all possible errors
// will be returned, including all Conditions checks.
CompleteValidation bool
}