Permissions
synapseclient.Permissions
dataclass
¶
The permission a user has for a given Entity. The set of permissoins is a calculation based several factors including the permission granted by the Entity's ACL and the User's group membership.
ATTRIBUTE | DESCRIPTION |
---|---|
can_view |
Can the user view this entity?
|
can_edit |
Can the user edit this entity?
|
can_move |
(Read Only) Can the user move this entity by changing its parentId?
|
can_add_child |
Can the user add a child entity to this entity?
|
can_certified_user_edit |
(Read Only) Can the user edit this entity once they become a Certified User?
|
can_certified_user_add_child |
(Read Only) Can the user add a child entity to this entity once they become a Certified User?
|
is_certified_user |
(Read Only) True, if the user has passed the user certification quiz.
|
can_change_permissions |
Can the user change the permissions of this entity?
|
can_change_settings |
Can the user change the settings of this entity?
|
can_delete |
Can the user delete this entity?
|
can_download |
Are there any access requirements precluding the user from downloading this entity?
|
can_upload |
(Read Only) Are there any access requirements precluding the user from uploading into this entity (folder or project)?
|
can_enable_inheritance |
(Read Only) Can the user delete the entity's access control list (so it inherits settings from an ancestor)?
|
owner_principal_id |
(Read Only) The principal ID of the entity's owner (i.e. the entity's 'createdBy').
|
can_public_read |
(Read Only) Is this entity considered public?
|
can_moderate |
Can the user moderate the forum associated with this entity? Note that only project entity has forum.
|
is_certification_required |
(Read Only) Is the certification requirement enabled for the project of the entity?
|
is_entity_open_data |
(Read Only) Returns true if the Entity's DateType equals 'OPEN_DATA', indicating that the data is safe to be released to the public.
|
Source code in synapseclient/core/models/permission.py
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
Attributes¶
access_types: List[str]
property
¶
Determine from the permissions set on this object what the access types are.
RETURNS | DESCRIPTION |
---|---|
List[str]
|
A list of access type strings for this object based off of what permissions are set. |
Using this property
A permission that has nothing set
no_permissions = Permissions()
print(no_permissions.access_types)
# Prints: []
A permission that has can_view set to True and nothing else set
read_permission = Permissions()
read_permission.can_view = True
print(read_permission.access_types)
# Prints: ['READ']
Special Case: a permission that has can_view set to True and nothing else set on an entity created by you. CHANGE_SETTINGS is bound to ownerId. Since the entity is created by you, the CHANGE_SETTINGS will always be True.
read_permission = Permissions()
read_permission.can_view = True
print(read_permission.access_types)
# Prints: ['READ','CHANGE_SETTINGS']
A permission that has can_view and can_edit set to True and nothing else set
read_write_permission = Permissions()
read_write_permission.can_view = True
read_write_permission.can_edit = True
print(read_write_permission.access_types)
# Prints: ['READ', 'UPDATE']
Functions¶
from_dict(data)
classmethod
¶
Convert a data dictionary to an instance of this dataclass
PARAMETER | DESCRIPTION |
---|---|
data |
a data dictionary of the UserEntityPermissions
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Permissions
|
A Permission object |
Source code in synapseclient/core/models/permission.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|