| | | 1 | | @using MUNity.Database.Models.Website |
| | | 2 | | @using MUNity.Database.Context |
| | | 3 | | @using Microsoft.EntityFrameworkCore |
| | | 4 | | @inject Services.UserConferenceAuthService conferenceAuthService |
| | | 5 | | @inject MunityContext dbContext |
| | | 6 | | |
| | 0 | 7 | | @if (isAuthorized) |
| | 0 | 8 | | { |
| | | 9 | | <div class="row"> |
| | | 10 | | <ul class="nav nav-tabs"> |
| | | 11 | | <li class="nav-item"> |
| | | 12 | | <a href="#default-tab-1" data-bs-toggle="tab" class="nav-link active"> |
| | | 13 | | <span class="d-sm-none">Auf Delegation</span> |
| | | 14 | | <span class="d-sm-block d-none">Auf Delegation</span> |
| | | 15 | | </a> |
| | | 16 | | </li> |
| | | 17 | | <li class="nav-item"> |
| | | 18 | | <a href="#default-tab-2" data-bs-toggle="tab" class="nav-link"> |
| | | 19 | | <span class="d-sm-none">Auf Rolle</span> |
| | | 20 | | <span class="d-sm-block d-none">Auf Rolle</span> |
| | | 21 | | </a> |
| | | 22 | | </li> |
| | | 23 | | </ul> |
| | | 24 | | </div> |
| | | 25 | | |
| | | 26 | | <div class="tab-pane fade active show" id="default-tab-1"> |
| | | 27 | | <ManageApplicationFormulaDelegation ConferenceId="@ConferenceId" /> |
| | | 28 | | </div> |
| | 0 | 29 | | } |
| | | 30 | | else |
| | 0 | 31 | | { |
| | | 32 | | <div class="alert alert-danger"> |
| | | 33 | | Keine Berechtigung Änderungen vor zu nehmen! |
| | | 34 | | </div> |
| | 0 | 35 | | } |
| | | 36 | | |
| | | 37 | | @code { |
| | 0 | 38 | | [Parameter] public string ConferenceId { get; set; } |
| | | 39 | | |
| | 0 | 40 | | [CascadingParameter] public Task<AuthenticationState> AuthStateTask { get; set; } |
| | | 41 | | |
| | 0 | 42 | | private bool isAuthorized = false; |
| | | 43 | | |
| | | 44 | | protected override async Task OnInitializedAsync() |
| | 0 | 45 | | { |
| | 0 | 46 | | await base.OnInitializedAsync(); |
| | 0 | 47 | | var claim = (await AuthStateTask)?.User; |
| | 0 | 48 | | if (claim != null) |
| | 0 | 49 | | { |
| | 0 | 50 | | this.isAuthorized = await conferenceAuthService.IsUserAllowedToEditConference(ConferenceId, claim); |
| | 0 | 51 | | } |
| | 0 | 52 | | } |
| | | 53 | | } |