0001-misc-restore-usage-of-CallableTrue-41391.patch
hobo/rest_authentication.py | ||
---|---|---|
8 | 8 |
from django.conf import settings |
9 | 9 |
from django.contrib.auth.models import AnonymousUser |
10 | 10 |
from django.db.models.fields import FieldDoesNotExist |
11 |
from django.utils.deprecation import CallableTrue |
|
11 | 12 |
from django.utils.module_loading import import_string |
12 | 13 | |
13 | 14 |
try: |
... | ... | |
18 | 19 | |
19 | 20 |
class AnonymousAuthenticServiceUser(AnonymousUser): |
20 | 21 |
'''This virtual user hold permissions for other publik services''' |
21 |
is_anonymous = True |
|
22 |
is_authenticated = True |
|
22 | ||
23 |
@property |
|
24 |
def is_anonymous(self): |
|
25 |
return CallableTrue |
|
26 | ||
27 |
@property |
|
28 |
def is_authenticated(self): |
|
29 |
return CallableTrue |
|
23 | 30 | |
24 | 31 |
def has_perm(self, perm_or_perms, obj=None): |
25 | 32 |
return True |
... | ... | |
41 | 48 |
class AnonymousAdminServiceUser(AnonymousUser): |
42 | 49 |
'''This virtual user hold permissions for other publik services''' |
43 | 50 |
is_staff = True |
44 |
is_anonymous = True |
|
45 |
is_authenticated = True |
|
51 | ||
52 |
@property |
|
53 |
def is_anonymous(self): |
|
54 |
return CallableTrue |
|
55 | ||
56 |
@property |
|
57 |
def is_authenticated(self): |
|
58 |
return CallableTrue |
|
46 | 59 | |
47 | 60 |
def __unicode__(self): |
48 | 61 |
return 'Publik Service Admin' |
49 |
- |