refactor(adminui): replace authorization string literals with AdminUiPolicies constants
This commit is contained in:
@@ -87,7 +87,7 @@ else
|
||||
@if (store.Kind is StoreKind.Trusted or StoreKind.Rejected)
|
||||
{
|
||||
<td>
|
||||
<AuthorizeView Policy="FleetAdmin">
|
||||
<AuthorizeView Policy="@AdminUiPolicies.FleetAdmin">
|
||||
<Authorized>
|
||||
@if (store.Kind == StoreKind.Rejected)
|
||||
{
|
||||
@@ -183,7 +183,7 @@ else
|
||||
// Defense-in-depth: the action buttons are FleetAdmin-gated in markup, but this handler
|
||||
// runs on the server circuit — re-check the policy before mutating the trust store.
|
||||
var authState = await AuthState.GetAuthenticationStateAsync();
|
||||
if (!(await AuthorizationService.AuthorizeAsync(authState.User, null, "FleetAdmin")).Succeeded)
|
||||
if (!(await AuthorizationService.AuthorizeAsync(authState.User, null, AdminUiPolicies.FleetAdmin)).Succeeded)
|
||||
{
|
||||
_statusError = true;
|
||||
_statusMsg = "Unauthorized — FleetAdmin required.";
|
||||
|
||||
Reference in New Issue
Block a user