Skip to content

Commit 79c6460

Browse files
committed
Revert "sources/collections/concepts/mappings urls have mandatory parent/owner scopes"
This reverts commit a12df18.
1 parent 25b1d73 commit 79c6460

6 files changed

Lines changed: 88 additions & 111 deletions

File tree

core/collections/views.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ class CollectionBaseView(BaseAPIView):
5757
permission_classes = (CanViewConceptDictionary,)
5858
queryset = Collection.objects.filter(is_active=True)
5959

60-
def verify_scope(self):
61-
has_owner_scope = self.has_owner_scope()
62-
has_no_kwargs = self.has_no_kwargs()
63-
if has_no_kwargs:
64-
if self.request.method not in ['GET', 'HEAD']:
65-
raise Http404()
66-
elif not has_owner_scope:
67-
raise Http404()
68-
6960
def set_parent_resource(self):
7061
from core.orgs.models import Organization
7162
from core.users.models import UserProfile

core/common/views.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,6 @@ class BaseAPIView(generics.GenericAPIView, PathWalkerMixin):
5151
facet_class = None
5252
total_count = 0
5353

54-
def has_no_kwargs(self):
55-
return len(self.kwargs.values()) == 0
56-
57-
def has_owner_scope(self):
58-
kwargs = self.kwargs.keys()
59-
return 'org' in kwargs or 'user' in kwargs
60-
61-
def has_concept_container_scope(self):
62-
kwargs = self.kwargs.keys()
63-
return 'source' in kwargs or 'collection' in kwargs
64-
65-
def has_parent_scope(self):
66-
return self.has_owner_scope() and self.has_concept_container_scope()
67-
6854
def _should_exclude_retired_from_search_results(self):
6955
if self.is_owner_document_model():
7056
return False
@@ -83,12 +69,8 @@ def is_verbose(self):
8369
def is_brief(self):
8470
return self.request.query_params.get(BRIEF_PARAM, False) in ['true', True]
8571

86-
def verify_scope(self):
87-
pass
88-
8972
def initial(self, request, *args, **kwargs):
9073
super().initial(request, *args, **kwargs)
91-
self.verify_scope()
9274
self.initialize(request, request.path_info, **kwargs)
9375

9476
def initialize(self, request, path_info_segment, **kwargs): # pylint: disable=unused-argument
@@ -595,15 +577,6 @@ def initial(self, request, *args, **kwargs):
595577
super().initial(request, *args, **kwargs)
596578
self.__set_params()
597579

598-
def verify_scope(self):
599-
has_parent_scope = self.has_parent_scope()
600-
has_no_kwargs = self.has_no_kwargs()
601-
if has_no_kwargs:
602-
if self.request.method not in ['GET', 'HEAD']:
603-
raise Http404()
604-
elif not has_parent_scope:
605-
raise Http404()
606-
607580
def get_filter_params(self):
608581
if self.params:
609582
return self.params

0 commit comments

Comments
 (0)