This commit is contained in:
Nik 2016-09-29 10:38:36 +00:00 committed by GitHub
commit 063873fac4

View File

@ -88,9 +88,7 @@ class SchemaGenerator(object):
if request is not None: if request is not None:
view.request = clone_request(request, method) view.request = clone_request(request, method)
try: if not self.check_view_permission(view):
view.check_permissions(view.request)
except exceptions.APIException:
continue continue
else: else:
view.request = None view.request = None
@ -165,6 +163,13 @@ class SchemaGenerator(object):
return True return True
def check_view_permission(self, view):
try:
view.check_permissions(view.request)
except exceptions.APIException:
return False
return True
def get_allowed_methods(self, callback): def get_allowed_methods(self, callback):
""" """
Return a list of the valid HTTP methods for this endpoint. Return a list of the valid HTTP methods for this endpoint.