about summary refs log tree commit diff
path: root/migrations/auth/20250729_01_CNn2p-create-initial-system-wide-resources-access-privileges.py
blob: be0d022b5e6f9fe7236e7a4e1baba7918a711a6c (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
"""
Create initial system-wide resources access privileges
"""

from yoyo import step

__depends__ = {'20250722_02_M8TXv-add-system-user-edit-privilege-to-system-admin-role'}

steps = [
    step(
        """
        INSERT INTO privileges(privilege_id, privilege_description)
        VALUES
          ("system:resource:view",
           "View the wrapper resource object (not attached data). This is mostly for administration purposes."),
          ("system:resource:edit",
           "Edit/update the wrapper resource object (not attached data). This is mostly for administration purposes."),
          ("system:resource:delete",
           "Delete the wrapper resource object (not attached data). This is mostly for administration purposes."),
          ("system:resource:reassign-group",
           "Reassign the resource, and its data, to a different user group."),
          ("system:resource:assign-owner",
           "Assign ownership of any resource to any user.")
        """,
        """
        DELETE FROM privileges WHERE privilege_id IN
          ("system:resource:view", "system:resource:edit",
           "system:resource:delete", "system:resource:reassign-group",
           "system:resource:assign-owner")
        """)
]