예제 #1
0
 def get_permission(self):
     if self.request.method in permissions.SAFE_METHODS:
         return (permissions.AllowAny(), )
     return (
         permissions.isAuthenticated(),
         IsAuthorOfPost(),
     )
예제 #2
0
    def get_permissions(self):
        if self.request.method in permissions.SAFE_METHODS:
            return (permissions.AllowAny(),)

        if self.request.method == 'POST':
            return (permissions.AllowAny(),)

        return (permissions.isAuthenticated(), IsAccountOwner(),)
예제 #3
0
파일: views.py 프로젝트: alphaTen/thinkster
	def get_permission(self):
		if self.request.method in permissions.SAFE_METHODS:
			return (permissions.AllowAny(),)
		return (permissions.isAuthenticated(), IsAuthorOfPost(),)