@using BTCPayServer.Views.Server @using BTCPayServer.Views.Stores @using Microsoft.AspNetCore.Mvc.TagHelpers @using BTCPayServer.Client @model BTCPayServer.Models.ServerViewModels.RolesViewModel @{ var storeId = Context.GetRouteValue("storeId") as string; var controller = ViewContext.RouteData.Values["controller"].ToString().TrimEnd("Controller", StringComparison.InvariantCultureIgnoreCase); if (string.IsNullOrEmpty(storeId)) ViewData.SetActivePage(ServerNavPages.Roles); else ViewData.SetActivePage(StoreNavPages.Roles); var permission = string.IsNullOrEmpty(storeId) ? Policies.CanModifyServerSettings : Policies.CanModifyStoreSettings; var nextRoleSortOrder = (string) ViewData["NextRoleSortOrder"]; var roleSortOrder = nextRoleSortOrder switch { "asc" => "desc", "desc" => "asc", _ => null }; const string sortByDesc = "Sort by name descending..."; const string sortByAsc = "Sort by name ascending..."; var showInUseColumn = !Model.Roles.Any(r => r.IsUsed is null); }
Role
|
Scope | Permissions | @if (showInUseColumn) {In use | }Actions |
---|---|---|---|---|
@role.Role
@if (Model.DefaultRole == role.Id)
{
Default
}
|
@if (role.IsServerRole) { Server-wide } else { Store-level } |
@if (!role.Permissions.Any())
{
@Policies.DisplayName(policy)
}
}
|
@if (showInUseColumn)
{
@if (role.IsUsed is true)
{
|
}