Commit 0f715b83 authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #115 from pearkes/master

Respond with a 404 status code to inaccessible resources
parents 264c2b42 ce20c14b
...@@ -244,7 +244,7 @@ class BaseView(object): ...@@ -244,7 +244,7 @@ class BaseView(object):
This method will be executed before calling any view method. This method will be executed before calling any view method.
By default, it will check if admin class is accessible and if it is not - will By default, it will check if admin class is accessible and if it is not - will
throw HTTP 403 error. throw HTTP 404 error.
:param name: :param name:
View function name View function name
...@@ -252,7 +252,7 @@ class BaseView(object): ...@@ -252,7 +252,7 @@ class BaseView(object):
View function arguments View function arguments
""" """
if not self.is_accessible(): if not self.is_accessible():
return abort(403) return abort(404)
class AdminIndexView(BaseView): class AdminIndexView(BaseView):
......
...@@ -178,7 +178,7 @@ def test_permissions(): ...@@ -178,7 +178,7 @@ def test_permissions():
view.allow_access = False view.allow_access = False
rv = client.get('/admin/mockview/') rv = client.get('/admin/mockview/')
eq_(rv.status_code, 403) eq_(rv.status_code, 404)
def test_submenu(): def test_submenu():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment