Skip to content

Commit

Permalink
Bug Nutzer kann Abfrage Löschen Popup öffnen (#100)
Browse files Browse the repository at this point in the history
* 🐛 Bugfix Löschen Abfrage

* Review Änderungen implementiert

---------

Co-authored-by: tiago.kocevar <[email protected]>
  • Loading branch information
TiagoKocevar and TiagoKocevar authored Aug 28, 2023
1 parent 4d812db commit e624fa2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/mixins/security/AbfrageSecurityMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ export default class AbfrageSecurityMixin extends Mixins(SecurityMixin) {
abfrage.abfrage?.statusAbfrage === StatusAbfrage.InBearbeitungSachbearbeitung
: false;
}

public isEditableByAdmin(): boolean {
const abfrage: InfrastrukturabfrageModel = this.$store.getters["search/selectedAbfrage"];
return !_.isNil(abfrage) ? this.isRoleAdmin() : false;
}
}
5 changes: 5 additions & 0 deletions frontend/src/views/Abfrage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
color="primary"
elevation="1"
style="width: 200px"
:disabled="!isDeleteable()"
@click="deleteAbfrage()"
v-text="'Löschen'"
/>
Expand Down Expand Up @@ -396,6 +397,10 @@ export default class Abfrage extends Mixins(
this.isDeleteDialogAbfrageOpen = true;
}
private isDeleteable(): boolean {
return this.isEditableByAbfrageerstellung() || this.isEditableByAdmin();
}
private statusUebergang(transition: TransitionDto): void {
this.transition = transition;
this.dialogTextStatus = transition.dialogText as string;
Expand Down

0 comments on commit e624fa2

Please sign in to comment.