Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/d/j/djangorestframework-extensions-0.0.3/djangorestframework_extensions/permissions.py   djangorestframework-extensions(Download)
from django.contrib.auth.models import User, Group
from djangorestframework import status
from djangorestframework.response import ErrorResponse
from djangorestframework.permissions import SAFE_METHODS, BasePermission
from djangorestframework_extensions.utils import user_passes_test
    def check_permission(self, user):
        if (not user.is_staff and
            self.view.method not in SAFE_METHODS):
            raise ErrorResponse(status.HTTP_403_FORBIDDEN,
                {'detail':
    def check_permission(self, user):
        if self.view.method in SAFE_METHODS:
            return True
 
PERMISSION_LOOKUP = {