This repository has been archived by the owner on Jun 5, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
CslaPolicy not found when used in AuthorizeView #927
Comments
This happens in a repeatable manner, like all the time? |
Yes. I removed the lines from all of the pages and replace them with if statements utilizing the HasPermission business rule and that worked. |
I'd recommend looking through the book and ProjectTracker samples. I updated them over the past couple days and am not seeing this issue. A lot of Blazor packages changed in the last couple previews, and for sure in client-side Blazor it is now necessary to explicitly call The BIG THING is that, for client-side Blazor, the |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Question
I have several "AuthorizeView Policy=" statements in my razor pages the utilize the CslaPolicy.GetPolicy as such
@using Csla.Rules ... <AuthorizeView Policy="@(CslaPolicy.GetPolicy(AuthorizationActions.CreateObject, typeof(Shared.Customer)))"> ... </AuthorizeView>
However, I am getting the following error:
System.InvalidOperationException: The AuthorizationPolicy named: 'Csla:CreateObject|Shared.Customer, Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' was not found.
at Microsoft.AspNetCore.Authorization.AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider policyProvider, IEnumerable`1 authorizeData)
at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.IsAuthorizedAsync(ClaimsPrincipal user)
at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Cannot access a disposed object.
Were there any configuration settings changed or something I am missing that would cause this error?
Version and Platform
CSLA version: 5.2.0
OS: Windows
Platform: Blazor
The text was updated successfully, but these errors were encountered: