Skip to content

Commit 747d744

Browse files
authored
Merge pull request #486 from hashtopolis/1353-bug-user-permissions-new-agent-button
Add missing check for agent role to display/hide new agent button in …
2 parents 622430b + c6e6063 commit 747d744

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/app/agents/show-agents/show-agents.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
title="Agents Overview"
44
buttontitle="New Agent"
55
buttonlink="/agents/new-agent"
6-
[subbutton]="true"
6+
[subbutton]="this.agentRoleService.hasRole('create')"
77
></app-page-title>
88
<agents-table name="agentsTable"></agents-table>
99
</app-table>
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component } from '@angular/core';
22

3+
import { AgentRoleService } from '@services/roles/agents/agent-role.service';
34
import { AutoTitleService } from '@services/shared/autotitle.service';
45

56
@Component({
@@ -8,7 +9,10 @@ import { AutoTitleService } from '@services/shared/autotitle.service';
89
standalone: false
910
})
1011
export class ShowAgentsComponent {
11-
constructor(private titleService: AutoTitleService) {
12+
constructor(
13+
private titleService: AutoTitleService,
14+
protected agentRoleService: AgentRoleService
15+
) {
1216
this.titleService.set(['Agents Overview']);
1317
}
1418
}

src/app/shared/page-headers/page-title/page-title.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Component, Input } from '@angular/core';
2-
32
import { Router } from '@angular/router';
43

54
@Component({
6-
selector: 'app-page-title',
7-
templateUrl: './page-title.component.html',
8-
standalone: false
5+
selector: 'app-page-title',
6+
templateUrl: './page-title.component.html',
7+
standalone: false
98
})
109
export class PageTitleComponent {
1110
@Input() title: string;

0 commit comments

Comments
 (0)