Skip to content

Commit

Permalink
fix analytics permissions (cvat-ai#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
azhavoro authored and Fernando Martínez González committed Aug 3, 2020
1 parent 7a945b1 commit dd158b3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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)

0 comments on commit dd158b3

Please sign in to comment.