Return current user permissions when session is checked via API
This commit is contained in:
parent
47efc88228
commit
de46dfc4a2
|
@ -53,9 +53,12 @@ class AuthenticationView(APIView):
|
||||||
This will establish a server-side web session for the user if none
|
This will establish a server-side web session for the user if none
|
||||||
exists. Note that this also resets the user's session timer.
|
exists. Note that this also resets the user's session timer.
|
||||||
"""
|
"""
|
||||||
|
data = {'ok': True}
|
||||||
if self.request.user:
|
if self.request.user:
|
||||||
return self.user_info(self.request.user)
|
data = self.user_info(self.request.user)
|
||||||
return {}
|
data['user']['is_root'] = self.request.is_root
|
||||||
|
data['permissions'] = list(self.request.tailbone_cached_permissions)
|
||||||
|
return data
|
||||||
|
|
||||||
@api
|
@api
|
||||||
def login(self):
|
def login(self):
|
||||||
|
|
Loading…
Reference in a new issue