1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

fix: cleanup old user permissions

This commit is contained in:
Ivar Conradi Østhus 2021-12-01 20:49:57 +01:00
parent 69383e17aa
commit 50b0c86312
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09
2 changed files with 2 additions and 5 deletions

View File

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

View File

@ -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,
}));
}