-
{{role.name}}
-
-
-
+
+
+
+
+
+ Endpoint |
+ {{element.endpoint_name}} |
+
+
+
+ Role |
+ {{element.role_name}} |
+
+
+ Propagate |
+ {{element.propagate}} |
+
+
+ Allowed |
+ {{element.allowed}} |
+
+
+
+
+
+
+
+
diff --git a/src/app/components/group-details/group-details.component.scss b/src/app/components/group-details/group-details.component.scss
index e8417eab..b2b1f702 100644
--- a/src/app/components/group-details/group-details.component.scss
+++ b/src/app/components/group-details/group-details.component.scss
@@ -1,3 +1,7 @@
+table {
+ width: 100%;
+}
+
.main {
display: flex;
justify-content: space-around;
diff --git a/src/app/components/group-details/group-details.component.ts b/src/app/components/group-details/group-details.component.ts
index eb0eb475..6dbe26c8 100644
--- a/src/app/components/group-details/group-details.component.ts
+++ b/src/app/components/group-details/group-details.component.ts
@@ -22,8 +22,14 @@ import {RemoveToGroupDialogComponent} from "@components/group-details/remove-to-
import {GroupService} from "@services/group.service";
import {ToasterService} from "@services/toaster.service";
import {PageEvent} from "@angular/material/paginator";
+import {ACE, ACEDetailed, AceType} from "@models/api/ACE";
+import {UserService} from "@services/user.service";
+import {RoleService} from "@services/role.service";
import {Role} from "@models/api/role";
-import {AddRoleToGroupComponent} from "@components/group-details/add-role-to-group/add-role-to-group.component";
+import {AclService} from "@services/acl.service";
+import {Endpoint} from "@models/api/endpoint";
+import {interval} from "rxjs";
+import {MatTableDataSource} from "@angular/material/table";
@Component({
selector: 'app-group-details',
@@ -37,28 +43,43 @@ export class GroupDetailsComponent implements OnInit {
editGroupForm: UntypedFormGroup;
pageEvent: PageEvent | undefined;
searchMembers: string;
- roles: Role[];
+ aces: ACE[];
+ aceDatasource = new MatTableDataSource
();
+ public aceDisplayedColumns = ['endpoint', 'role', 'propagate', 'allowed'];
constructor(private route: ActivatedRoute,
private dialog: MatDialog,
private groupService: GroupService,
- private toastService: ToasterService) {
+ private toastService: ToasterService,
+ private aclService: AclService,
+ private roleService: RoleService) {
this.editGroupForm = new UntypedFormGroup({
groupname: new UntypedFormControl(''),
});
- this.route.data.subscribe((d: { controller: Controller; group: Group, members: User[], roles: Role[] }) => {
+ this.route.data.subscribe((d: { controller: Controller; group: Group, members: User[], aces: ACE[] }) => {
this.controller = d.controller;
this.group = d.group;
- this.roles = d.roles;
+ this.aces = d.aces;
this.members = d.members.sort((a: User, b: User) => a.username.toLowerCase().localeCompare(b.username.toLowerCase()));
this.editGroupForm.setValue({groupname: this.group.name});
});
+
+
}
ngOnInit(): void {
+ this.roleService.get(this.controller).subscribe((roles: Role[]) => {
+ this.aclService.getEndpoints(this.controller).subscribe((endps: Endpoint[]) => {
+ this.aceDatasource.data = this.aces.map((ace: ACE) => {
+ const endpoint = endps.filter((endp: Endpoint) => endp.endpoint === ace.path)[0]
+ const role = roles.filter((r: Role) => r.role_id === ace.role_id)[0]
+ return {...ace, endpoint_name: endpoint.name, role_name: role.name}
+ })
+ })
+ })
}
@@ -72,18 +93,6 @@ export class GroupDetailsComponent implements OnInit {
});
}
- openAddRoleDialog() {
- this.dialog
- .open(AddRoleToGroupComponent,
- {
- width: '700px', height: '500px',
- data: {controller: this.controller, group: this.group}
- })
- .afterClosed()
- .subscribe(() => {
- this.reloadRoles();
- });
- }
openAddUserDialog() {
this.dialog
.open(AddUserToGroupDialogComponent,
@@ -117,24 +126,6 @@ export class GroupDetailsComponent implements OnInit {
}
- openRemoveRoleDialog(role: Role) {
- this.dialog.open(RemoveToGroupDialogComponent,
- {width: '500px', height: '200px', data: {name: role.name}})
- .afterClosed()
- .subscribe((confirm: string) => {
- if (confirm) {
- this.groupService.removeRole(this.controller, this.group, role)
- .subscribe(() => {
- this.toastService.success(`Role ${role.name} was removed`);
- this.reloadRoles();
- },
- (error) => {
- this.toastService.error(`Error while removing role ${role.name} from ${this.group.name}`);
- console.log(error);
- });
- }
- });
- }
reloadMembers() {
this.groupService.getGroupMember(this.controller, this.group.user_group_id)
@@ -143,10 +134,4 @@ export class GroupDetailsComponent implements OnInit {
});
}
- reloadRoles() {
- this.groupService.getGroupRole(this.controller, this.group.user_group_id)
- .subscribe((roles: Role[]) => {
- this.roles = roles;
- });
- }
}
diff --git a/src/app/components/resource-pool-details/resource-pool-details.component.html b/src/app/components/resource-pool-details/resource-pool-details.component.html
index bc2a77cc..51db7933 100644
--- a/src/app/components/resource-pool-details/resource-pool-details.component.html
+++ b/src/app/components/resource-pool-details/resource-pool-details.component.html
@@ -8,7 +8,7 @@
[routerLink]="['/controller', controller.id, 'management', 'resourcePools']">
keyboard_arrow_left
- role {{pool.name}} details
+ Pool {{pool.name}} details
@@ -23,7 +23,7 @@
uuid: {{pool.resource_pool_id}}
diff --git a/src/app/components/user-management/user-detail/user-detail.component.html b/src/app/components/user-management/user-detail/user-detail.component.html
index 11462e39..78c1626a 100644
--- a/src/app/components/user-management/user-detail/user-detail.component.html
+++ b/src/app/components/user-management/user-detail/user-detail.component.html
@@ -80,6 +80,37 @@