Return current user permissions when session is checked via API

This commit is contained in:
Lance Edgar 2019-08-29 19:42:01 -05:00
parent 47efc88228
commit de46dfc4a2

View file

@ -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):