Return new user permissions when logging in via API
This commit is contained in:
		
							parent
							
								
									5e028ce547
								
							
						
					
					
						commit
						c96ab426a4
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -26,7 +26,7 @@ Tailbone Web API - Auth Views
 | 
			
		|||
 | 
			
		||||
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.db import Session
 | 
			
		||||
| 
						 | 
				
			
			@ -84,6 +84,7 @@ class AuthenticationView(APIView):
 | 
			
		|||
        return {
 | 
			
		||||
            'ok': True,
 | 
			
		||||
            'user': self.get_user_info(user),
 | 
			
		||||
            'permissions': list(cache_permissions(Session(), user)),
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    def authenticate_user(self, username, password):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue