Skip to content

Permissions

Permissions

Bases: Enum

Options of permissions for resources and values:

  • PROJECT_SPECIFIC_PERMISSIONS: the permissions defined on project level will be applied
  • PUBLIC: the resource/value is visible for everyone
  • PRIVATE: the resource/value is only visible for project members
  • LIMITED_VIEW: the resource/value is visible for everyone, but images are blurred/watermarked for non-project members

Deprecated terms:

  • OPEN: use PUBLIC instead
  • RESTRICTED: use PRIVATE instead
  • RESTRICTED_VIEW: use LIMITED_VIEW instead

Examples:

resource = xmllib.Resource.create_new(
    res_id="ID",
    restype=":ResourceType",
    label="label",
    permissions=xmllib.Permissions.PRIVATE,
)
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/permissions.py
 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
class Permissions(Enum):
    """
    Options of permissions for resources and values:

    - `PROJECT_SPECIFIC_PERMISSIONS`: the permissions defined on project level will be applied
    - `PUBLIC`: the resource/value is visible for everyone
    - `PRIVATE`: the resource/value is only visible for project members
    - `LIMITED_VIEW`: the resource/value is visible for everyone,
      but images are blurred/watermarked for non-project members

    Deprecated terms:

    - `OPEN`: use `PUBLIC` instead
    - `RESTRICTED`: use `PRIVATE` instead
    - `RESTRICTED_VIEW`: use `LIMITED_VIEW` instead

    Examples:
        ```python
        resource = xmllib.Resource.create_new(
            res_id="ID",
            restype=":ResourceType",
            label="label",
            permissions=xmllib.Permissions.PRIVATE,
        )
        ```
    """

    PROJECT_SPECIFIC_PERMISSIONS = ""
    PUBLIC = "public"
    PRIVATE = "private"
    LIMITED_VIEW = "limited_view"

    # Deprecated terminology
    OPEN = "open"
    RESTRICTED = "restricted"
    RESTRICTED_VIEW = "restricted-view"