Skip to content

Commit

Permalink
Hide speciality delete button for non gm
Browse files Browse the repository at this point in the history
  • Loading branch information
Socolin committed Mar 18, 2024
1 parent 5e4dfea commit ba7a890
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/actor/character-specialities.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h3>{{ 'Sheet.Specialities.Title' | translate }}</h3>
<button (click)="createMacro(menuContent, characterSpeciality.speciality)">
<i class="fas fa-scroll"></i> Créer une macro
</button>
<button (click)="deleteSpeciality(menuContent, characterSpeciality)">
<button (click)="deleteSpeciality(menuContent, characterSpeciality)" *ngIf="canForgetSpeciality()">
<i class="fas fa-trash"></i> Supprimer
</button>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/app/actor/character-specialities.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
SelectSpecialityDialogData,
SelectSpecialityDialogResult
} from '../speciality/select-speciality-dialog.component';
import {UserService} from '../shared/user-service';

@Component({
selector: 'lvl0-character-specialities',
Expand All @@ -33,6 +34,7 @@ export class CharacterSpecialitiesComponent implements OnInit {
private readonly dialogService: DialogService,
private readonly macroService: MacroService,
private readonly specialityService: SpecialityService,
private readonly userService: UserService,
) {
}

Expand Down Expand Up @@ -67,4 +69,8 @@ export class CharacterSpecialitiesComponent implements OnInit {
});
})
}

canForgetSpeciality() {
return this.userService.isGm();
}
}

0 comments on commit ba7a890

Please sign in to comment.