Skip to content

Commit 908fc16

Browse files
committed
IOT-471: Fix Check if is global admin
1 parent cf23171 commit 908fc16

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/app/admin/users/user-edit/user-edit.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { TranslateService } from '@ngx-translate/core';
88
import { UserService } from '../user.service';
99
import { Subscription } from 'rxjs';
1010
import { Location } from '@angular/common';
11+
import { PermissionType } from '@app/admin/permission/permission.model';
1112

1213

1314
@Component({
@@ -58,7 +59,7 @@ export class UserEditComponent implements OnInit {
5859
this.user.email = response.email;
5960
this.user.id = response.id;
6061
this.user.active = response.active;
61-
this.user.globalAdmin = response.globalAdmin;
62+
this.user.globalAdmin = response.permissions.some(x => x.type == PermissionType.GlobalAdmin);
6263
// We cannot set the password.
6364
});
6465
}

src/app/admin/users/user.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export interface UserResponse {
1818
active: boolean;
1919
lastLogin: Date;
2020
permissions: PermissionResponse[];
21-
globalAdmin: boolean;
2221
}
2322

2423
export interface UserGetManyResponse {

0 commit comments

Comments
 (0)