Return new user permissions when logging in via API
This commit is contained in:
parent
5e028ce547
commit
c96ab426a4
|
@ -26,7 +26,7 @@ Tailbone Web API - Auth Views
|
||||||
|
|
||||||
from __future__ import unicode_literals, absolute_import
|
from __future__ import unicode_literals, absolute_import
|
||||||
|
|
||||||
from rattail.db.auth import authenticate_user, set_user_password
|
from rattail.db.auth import authenticate_user, set_user_password, cache_permissions
|
||||||
|
|
||||||
from tailbone.api import APIView, api
|
from tailbone.api import APIView, api
|
||||||
from tailbone.db import Session
|
from tailbone.db import Session
|
||||||
|
@ -84,6 +84,7 @@ class AuthenticationView(APIView):
|
||||||
return {
|
return {
|
||||||
'ok': True,
|
'ok': True,
|
||||||
'user': self.get_user_info(user),
|
'user': self.get_user_info(user),
|
||||||
|
'permissions': list(cache_permissions(Session(), user)),
|
||||||
}
|
}
|
||||||
|
|
||||||
def authenticate_user(self, username, password):
|
def authenticate_user(self, username, password):
|
||||||
|
|
Loading…
Reference in a new issue