-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathaction.py
More file actions
40 lines (32 loc) · 1.08 KB
/
action.py
File metadata and controls
40 lines (32 loc) · 1.08 KB
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
import enum
class AuthzedAction(enum.Enum):
"""
Identify the type of action being secured by the permissions framework, according to the familiar CRUD and Feast terminology.
"""
CREATE = "create" # Create an instance
DESCRIBE = "describe" # Access the instance state
UPDATE = "update" # Update the instance state
DELETE = "delete" # Delete an instance
READ_ONLINE = "read_online" # Read the online store only
READ_OFFLINE = "read_offline" # Read the offline store only
WRITE_ONLINE = "write_online" # Write to the online store only
WRITE_OFFLINE = "write_offline" # Write to the offline store only
# Alias for all available actions
ALL_ACTIONS = [a for a in AuthzedAction.__members__.values()]
# Alias for all read actions
READ = [
AuthzedAction.READ_OFFLINE,
AuthzedAction.READ_ONLINE,
]
# Alias for all write actions
WRITE = [
AuthzedAction.WRITE_OFFLINE,
AuthzedAction.WRITE_ONLINE,
]
# Alias for CRUD actions
CRUD = [
AuthzedAction.CREATE,
AuthzedAction.DESCRIBE,
AuthzedAction.UPDATE,
AuthzedAction.DELETE,
]