def METHOD_NAME(self, request, view):
    # Workaround to ensure DjangoModelPermissions are not applied
    # to the root view when using DefaultRouter.
    if getattr(view, '_ignore_rbac_permissions', False):
        return True
    if not request.user:
        return False
    if request.user.is_anonymous and self.authenticated_users_only:
        return False
    raw_action = getattr(view, 'raw_action', request.method)
    if raw_action in ['metadata', 'OPTIONS']:
        return True
    perms = self.get_require_perms(request, view)
    if isinstance(perms, str):
        perms = [perms]
    has = request.user.has_perms(perms)
    logger.debug('View require perms: {}, result: {}'.format(perms, has))
    return has