Skip to content

Commit

Permalink
add privileges.can_view_private_datasets to User.can_access_dataset()…
Browse files Browse the repository at this point in the history
…; does not grant ability to manipulate/run processors
  • Loading branch information
dale-wahl committed Feb 17, 2025
1 parent b28b31f commit 6b80bac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/lib/config_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"privileges.admin.can_manipulate_all_datasets": {
"type": UserInput.OPTION_TOGGLE,
"default": False,
"help": "Can manipulate datasets",
"help": "Can manipulate all datasets",
"tooltip": "Controls whether users can manipulate all datasets as if they were an owner, e.g. sharing it with "
"others, running processors, et cetera."
},
Expand Down
4 changes: 4 additions & 0 deletions common/lib/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ def can_access_dataset(self, dataset, role=None):

elif self.is_admin:
return True

elif self.config.get("privileges.can_view_private_datasets", user=self):
# Allowed to see dataset, but perhaps not run processors (need privileges.admin.can_manipulate_all_datasets or dataset ownership)
return True

elif dataset.is_accessible_by(self, role=role):
return True
Expand Down

0 comments on commit 6b80bac

Please sign in to comment.