Hi I have a project with many methods in view. Each method mapped to different urls.
views.py
def method1(request):
print 'hello world'
def method2(request):
print 'hello world2'
def method3(request):
print 'hello world3'
What i want is to do something related to permission so that the user can access only one method. e.g That is if user has permission for method2(), he/she can only access this method. He/she mustn't access method1() or method2().
Like described here https://djangosnippets.org/snippets/1703/, I can use user_pass_test() function but in this way i can restrict only one.
If I want to restrict all except one i have to apply decorators in all existing methods and there are alot of methods in my project.
Here I want to restrict all except one.
Please help.