diff --git a/tailbone/api/auth.py b/tailbone/api/auth.py index d85f2fb1..07c4464d 100644 --- a/tailbone/api/auth.py +++ b/tailbone/api/auth.py @@ -57,7 +57,16 @@ class AuthenticationView(APIView): if self.request.user: data = self.user_info(self.request.user) data['user']['is_root'] = self.request.is_root + data['permissions'] = list(self.request.tailbone_cached_permissions) + + # background color may be set per-request, by some apps + if hasattr(self.request, 'background_color') and self.request.background_color: + data['background_color'] = self.request.background_color + else: # otherwise we use the one from config + data['background_color'] = self.rattail_config.get( + 'tailbone', 'background_color') + return data @api