We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 18ba62f + 2bc27c5 commit ee90e09Copy full SHA for ee90e09
api/files/views.py
@@ -30,7 +30,6 @@
30
FileDetailSerializer,
31
FileVersionSerializer,
32
)
33
-from osf.utils.permissions import ADMIN
34
35
36
class FileMixin:
@@ -87,11 +86,11 @@ def get_target(self):
87
86
88
# overrides RetrieveAPIView
89
def get_object(self):
90
- user = utils.get_user_auth(self.request).user
91
file = self.get_file()
92
93
if self.request.GET.get('create_guid', False):
94
- if (self.get_target().has_permission(user, ADMIN) and utils.has_admin_scope(self.request)):
+ auth = utils.get_user_auth(self.request)
+ if self.get_target().can_view(auth):
95
file.get_guid(create=True)
96
97
# We normally would pass this through `get_file` as an annotation, but the `select_for_update` feature prevents
0 commit comments