| author | cavaliet |
| Fri, 03 Oct 2014 11:14:32 +0200 | |
| changeset 1324 | 0a425187f686 |
| parent 1191 | b6e0b1811723 |
| child 1360 | f69b5d8ba4b9 |
| permissions | -rw-r--r-- |
| 1191 | 1 |
from django.conf import settings |
2 |
from social_auth.backends import get_backends |
|
3 |
||
| 0 | 4 |
|
|
167
fe00e7302efe
Change class and functions names to follow PEP8 formatting standards
verrierj
parents:
13
diff
changeset
|
5 |
def check_access(user, obj): |
|
fe00e7302efe
Change class and functions names to follow PEP8 formatting standards
verrierj
parents:
13
diff
changeset
|
6 |
check_meth = getattr(obj, 'check_access', False) |
| 0 | 7 |
if check_meth: |
8 |
return check_meth(user) |
|
9 |
else: |
|
|
13
97ab7b3191cf
add api to update project, uses psiton
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
10 |
return user.is_staff |
| 1191 | 11 |
|
12 |
def social_list(): |
|
13 |
"""Start list process""" |
|
14 |
l = [] |
|
15 |
# We list all wanted backends among all availables |
|
16 |
for backend in get_backends(): |
|
17 |
for backend_str in settings.AUTHENTICATION_BACKENDS: |
|
18 |
if backend in backend_str: |
|
19 |
l.append(backend) |
|
20 |
return l |