mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
Fix the PermissionJsonConverter
This commit is contained in:
parent
094307d688
commit
ad4dbdad6d
@ -20,7 +20,7 @@ namespace BTCPayServer.Client.JsonConverters
|
||||
return null;
|
||||
if (reader.TokenType != JsonToken.String)
|
||||
throw new JsonObjectException("Type 'Permission' is expected to be a 'String'", reader);
|
||||
if (reader.ReadAsString() is String s && Permission.TryParse(s, out var permission))
|
||||
if (reader.Value is String s && Permission.TryParse(s, out var permission))
|
||||
return permission;
|
||||
throw new JsonObjectException("Invalid 'Permission' String", reader);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ namespace BTCPayServer.Security.APIKeys
|
||||
{
|
||||
case Policies.CanModifyProfile:
|
||||
case Policies.CanViewProfile:
|
||||
case Policies.Unrestricted:
|
||||
success = context.HasPermission(Permission.Create(requirement.Policy));
|
||||
break;
|
||||
|
||||
|
@ -56,16 +56,16 @@
|
||||
}
|
||||
else if (Model.StoreMode == ManageController.AddApiKeyViewModel.ApiKeyStoreMode.Specific)
|
||||
{
|
||||
<li class="list-group-item ">
|
||||
<div class="list-group-item ">
|
||||
<h5 class="mb-1">@Model.StoreManagementSelectivePermission.Title</h5>
|
||||
<span class="form-text text-muted">@Model.StoreManagementSelectivePermission.Description</span>
|
||||
<button type="submit" class="btn btn-link" name="command" value="change-store-mode">Give permission to all stores instead</button>
|
||||
</li>
|
||||
</div>
|
||||
@if (!Model.Stores.Any())
|
||||
{
|
||||
<li class="list-group-item alert-warning">
|
||||
<div class="list-group-item alert-warning">
|
||||
You currently have no stores configured.
|
||||
</li>
|
||||
</div>
|
||||
}
|
||||
@for (var index = 0; index < Model.SpecificStores.Count; index++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user