Skip to content
Snippets Groups Projects
Commit f85d2c4e authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

feat: add user delete structure

parent 8a186897
No related branches found
No related tags found
3 merge requests!85Recette,!84Dev,!75feat: add user delete structure
......@@ -136,7 +136,7 @@
>
Modifier cette structure
</a> -->
<a *ngIf="profileService.isAdmin()" (click)="toggleDeleteModal()" class="primary" tabindex="0">
<a *ngIf="canDelete()" (click)="toggleDeleteModal()" class="primary" tabindex="0">
Supprimer cette structure
</a>
</div>
......
......@@ -220,4 +220,11 @@ export class StructureDetailsComponent implements OnInit {
this.tclStopPoints = res;
});
}
public canDelete(): boolean {
if (this.profileService.isAdmin() || this.profileService.isLinkedToStructure(this.structure._id)) {
return true;
}
return false;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment