structs
Action
Bases: Vertex
A vertex type representing an action on a resource.
Source code in src/permission_graph/structs.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
Actor
Bases: Vertex
A vertex type representing an actor.
Source code in src/permission_graph/structs.py
61 62 63 64 |
|
EdgeType
Bases: Enum
Type for edges.
Values
ALLOW
: allow an actor to take an actionDENY
: deny an actor from taking an actionMEMBER_OF
: indicate membership in a collection
Source code in src/permission_graph/structs.py
106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
Effect
Bases: Enum
The effect of a permission policy.
Values
ALLOW
: action is allowedDENY
: action is not allowed
Source code in src/permission_graph/structs.py
134 135 136 137 138 139 140 141 142 143 144 |
|
Group
Bases: Vertex
A vertex type representing a group of Actors.
Source code in src/permission_graph/structs.py
67 68 69 70 |
|
PermissionPolicy
Bases: BaseModel
A permission policy statement.
PermissionPolicy objects represent a permission statement linking a user to an action.
Attributes:
Name | Type | Description |
---|---|---|
action |
Action
|
The policy's action |
actor |
Actor
|
The policy's actor |
resource |
Resource
|
The resource being acted upon |
resourceType |
ResourceType
|
The resource type of the resource being acted upon |
Source code in src/permission_graph/structs.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
Resource
Bases: Vertex
A vertex type representing a resource.
Source code in src/permission_graph/structs.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
ResourceType
Bases: Vertex
A vertex type representing resource types.
Source code in src/permission_graph/structs.py
49 50 51 52 53 54 55 56 57 58 |
|
TieBreakerPolicy
Bases: Enum
Policy for breaking ties in permissions graph.
Values
ANY_ALLOW
: allow if any of the candidate paths allow the actionALL_ALLOW
: allow only if all of the candidate paths allow the action
Source code in src/permission_graph/structs.py
121 122 123 124 125 126 127 128 129 130 131 |
|
Vertex
Bases: BaseModel
A vertex in the permission graph.
Source code in src/permission_graph/structs.py
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 |
|
factory(vertex_id, **kwargs)
staticmethod
Return a vertex object given vtype and vertex_id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vtype |
The type of the vertex ( |
required | |
vertex_id |
str
|
The id of the vertex |
required |
Source code in src/permission_graph/structs.py
36 37 38 39 40 41 42 43 44 45 46 |
|
from_id(vertex_id)
classmethod
Return an instance of this class from a vertex id.
Source code in src/permission_graph/structs.py
30 31 32 33 34 |
|