You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
421 B
22 lines
421 B
5 years ago
|
|
||
|
|
||
|
from django.core.cache import cache
|
||
|
|
||
|
import datetime
|
||
|
|
||
|
from rest_framework.authentication import BaseAuthentication
|
||
|
from rest_framework import exceptions
|
||
|
from api.models import Token
|
||
|
|
||
|
from rest_framework.permissions import BasePermission
|
||
|
|
||
|
class LoginUserPermission(BaseAuthentication):
|
||
|
|
||
|
def has_permission(self,request,view):
|
||
|
|
||
|
if request.user:
|
||
|
return True
|
||
|
else:
|
||
|
return False
|
||
|
|