30 lines
727 B
Plaintext
30 lines
727 B
Plaintext
@inject IUserContextAccessor UserContext
|
|
@inject TranslationSource T
|
|
@using SharepointToolbox.Web.Core.Models
|
|
@using SharepointToolbox.Web.Services.Session
|
|
|
|
@* Wrap write-only UI. TechN0 sees the ReadOnlyContent fallback. *@
|
|
|
|
@if (UserContext.Role >= UserRole.TechN1)
|
|
{
|
|
@ChildContent
|
|
}
|
|
else
|
|
{
|
|
@if (ReadOnlyContent is not null)
|
|
{
|
|
@ReadOnlyContent
|
|
}
|
|
else
|
|
{
|
|
<div class="alert alert-info">
|
|
@T["writeguard.readonly.before"] <strong>@T["writeguard.readonly.emphasis"]</strong> @T["writeguard.readonly.after"]
|
|
</div>
|
|
}
|
|
}
|
|
|
|
@code {
|
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
|
[Parameter] public RenderFragment? ReadOnlyContent { get; set; }
|
|
}
|