Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Az/fix analytics permissions #1608

Merged
merged 7 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A problem with mask to polygons conversion when polygons are too small (<https://github.com/opencv/cvat/pull/1581>)
- Unable to upload video with uneven size (<https://github.com/opencv/cvat/pull/1594>)
- Fixed an issue with `z_order` having no effect on segmentations (<https://github.com/opencv/cvat/pull/1589>)
- Permission group whitelist check for analytics view (<https://github.com/opencv/cvat/pull/1608>)

### Security
-
Expand Down
3 changes: 0 additions & 3 deletions cvat/apps/log_viewer/admin.py

This file was deleted.

3 changes: 0 additions & 3 deletions cvat/apps/log_viewer/models.py

This file was deleted.

3 changes: 0 additions & 3 deletions cvat/apps/log_viewer/tests.py

This file was deleted.

3 changes: 1 addition & 2 deletions cvat/apps/log_viewer/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright (C) 2018 Intel Corporation
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

Expand All @@ -9,4 +9,3 @@
urlpatterns = [
path('<path:path>', views.LogViewerProxy.as_view())
]

9 changes: 9 additions & 0 deletions cvat/apps/log_viewer/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

import os

from revproxy.views import ProxyView
Expand All @@ -20,3 +24,8 @@ def get_request_headers(self):
headers['X-Forwarded-User'] = headers['REMOTE_USER']

return headers

# Returns True if the user has any of the specified permissions
def has_permission(self):
perms = self.get_permission_required()
return any(self.request.user.has_perm(perm) for perm in perms)