# -*- coding: utf-8 -*-
"""
Это к REST api на базе tastypie
Created on Aug 11, 2016

@author: noob
"""

from tastypie.authentication import Authentication
from tastypie.authorization import Authorization
from tastypie.exceptions import Unauthorized


class NullAuthorization(Authorization):

    def delete_list(self, object_list, bundle):
        # Sorry user, no deletes for you!
        raise Unauthorized("Sorry, no deletes.")

    def delete_detail(self, object_list, bundle):
        raise Unauthorized("Sorry, no deletes.")


class NullAuthentication(Authentication):
    @staticmethod
    def is_authenticated(request, **kwargs):
        return True
