mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: cleanup old user permissions (#1150)
This commit is contained in:
		
							parent
							
								
									69383e17aa
								
							
						
					
					
						commit
						784ddf8fb3
					
				@ -65,9 +65,6 @@ class UserController extends Controller {
 | 
			
		||||
        );
 | 
			
		||||
        const splash = await this.userSplashService.getAllUserSplashs(user);
 | 
			
		||||
 | 
			
		||||
        // TODO: remove this line after we remove it from db.
 | 
			
		||||
        delete user.permissions;
 | 
			
		||||
 | 
			
		||||
        return res
 | 
			
		||||
            .status(200)
 | 
			
		||||
            .json({ user, permissions, feedback, splash })
 | 
			
		||||
 | 
			
		||||
@ -109,9 +109,9 @@ export class AccessService {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async getPermissionsForUser(user: User): Promise<IUserPermission[]> {
 | 
			
		||||
    async getPermissionsForUser(user: IUser): Promise<IUserPermission[]> {
 | 
			
		||||
        if (user.isAPI) {
 | 
			
		||||
            return user.permissions.map((p) => ({
 | 
			
		||||
            return user.permissions?.map((p) => ({
 | 
			
		||||
                permission: p,
 | 
			
		||||
            }));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user