Skip to content

Commit 645f7f5

Browse files
authored
Update the docstring for setPermissions to be clearer what 2 parameters do (#1164)
1 parent 65ba71d commit 645f7f5

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

synapseclient/client.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2908,9 +2908,18 @@ def setPermissions(
29082908
and '273949' is for public access. None implies public access.
29092909
accessType: Type of permission to be granted. One or more of CREATE, READ, DOWNLOAD, UPDATE,
29102910
DELETE, CHANGE_PERMISSIONS
2911-
modify_benefactor: Set as True when modifying a benefactor's ACL
2912-
warn_if_inherits: Set as False, when creating a new ACL.
2913-
Trying to modify the ACL of an Entity that inherits its ACL will result in a warning
2911+
modify_benefactor: Set as True when modifying a benefactor's ACL. The term
2912+
'benefactor' is used to indicate which Entity an Entity inherits its
2913+
ACL from. For example, a newly created Project will be its own
2914+
benefactor, while a new FileEntity's benefactor will start off as its
2915+
containing Project. If the entity already has local sharing settings
2916+
the benefactor would be itself. It may also be the immediate parent,
2917+
somewhere in the parent tree, or the project itself.
2918+
warn_if_inherits: When `modify_benefactor` is True, this does not have any
2919+
effect. When `modify_benefactor` is False, and `warn_if_inherits` is
2920+
True, a warning log message is produced if the benefactor for the
2921+
entity you passed into the function is not itself, i.e., it's the
2922+
parent folder, or another entity in the parent tree.
29142923
overwrite: By default this function overwrites existing permissions for the specified user.
29152924
Set this flag to False to add new permissions non-destructively.
29162925

synapseclient/models/mixins/access_control.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,18 @@ async def set_permissions_async(
109109
READ, DOWNLOAD, UPDATE, DELETE, CHANGE_PERMISSIONS.
110110
111111
**Defaults to ['READ', 'DOWNLOAD']**
112-
modify_benefactor: Set as True when modifying a benefactor's ACL
113-
warn_if_inherits: Set as False, when creating a new ACL. Trying to modify
114-
the ACL of an Entity that inherits its ACL will result in a warning
112+
modify_benefactor: Set as True when modifying a benefactor's ACL. The term
113+
'benefactor' is used to indicate which Entity an Entity inherits its
114+
ACL from. For example, a newly created Project will be its own
115+
benefactor, while a new FileEntity's benefactor will start off as its
116+
containing Project. If the entity already has local sharing settings
117+
the benefactor would be itself. It may also be the immediate parent,
118+
somewhere in the parent tree, or the project itself.
119+
warn_if_inherits: When `modify_benefactor` is True, this does not have any
120+
effect. When `modify_benefactor` is False, and `warn_if_inherits` is
121+
True, a warning log message is produced if the benefactor for the
122+
entity you passed into the function is not itself, i.e., it's the
123+
parent folder, or another entity in the parent tree.
115124
overwrite: By default this function overwrites existing permissions for
116125
the specified user. Set this flag to False to add new permissions
117126
non-destructively.

synapseclient/models/protocols/access_control_protocol.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,18 @@ def set_permissions(
8787
READ, DOWNLOAD, UPDATE, DELETE, CHANGE_PERMISSIONS.
8888
8989
**Defaults to ['READ', 'DOWNLOAD']**
90-
modify_benefactor: Set as True when modifying a benefactor's ACL
91-
warn_if_inherits: Set as False, when creating a new ACL. Trying to modify
92-
the ACL of an Entity that inherits its ACL will result in a warning
90+
modify_benefactor: Set as True when modifying a benefactor's ACL. The term
91+
'benefactor' is used to indicate which Entity an Entity inherits its
92+
ACL from. For example, a newly created Project will be its own
93+
benefactor, while a new FileEntity's benefactor will start off as its
94+
containing Project. If the entity already has local sharing settings
95+
the benefactor would be itself. It may also be the immediate parent,
96+
somewhere in the parent tree, or the project itself.
97+
warn_if_inherits: When `modify_benefactor` is True, this does not have any
98+
effect. When `modify_benefactor` is False, and `warn_if_inherits` is
99+
True, a warning log message is produced if the benefactor for the
100+
entity you passed into the function is not itself, i.e., it's the
101+
parent folder, or another entity in the parent tree.
93102
overwrite: By default this function overwrites existing permissions for
94103
the specified user. Set this flag to False to add new permissions
95104
non-destructively.

0 commit comments

Comments
 (0)