Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved default handling of PermissionValidationFailedException #406

Open
JornWildt opened this issue Mar 13, 2021 · 1 comment
Open

Improved default handling of PermissionValidationFailedException #406

JornWildt opened this issue Mar 13, 2021 · 1 comment
Milestone

Comments

@JornWildt
Copy link

If I show a list of entity view models and use the standard query mechanism, then it will throw PermissionValidationFailedException if the end user does not have access to the items. That is fine.

Unfortunately there is no default handling stating "You do not have access to this page". All I get is a message and a stack trace:

PermissionValidationFailedException: Permission Validation Check Failed. Permission Type: Cofoundry.Domain.CustomEntityReadPermission. UserId:

Cofoundry.Domain.Internal.PermissionValidationService.EnforcePermission(IPermissionApplication permission, IUserContext userContext)
Cofoundry.Domain.Internal.PermissionValidationService.EnforcePermission(IEnumerable<IPermissionApplication> permissions, IUserContext userContext)
Cofoundry.Domain.Internal.ExecutePermissionValidationService.Validate<TQuery, TResult>(TQuery query, IAsyncQueryHandler<TQuery, TResult> queryHandler, IExecutionContext executionContext)
Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteQueryAsync<TQuery, TResult>(TQuery query, IExecutionContext executionContext)
Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteAsync<TResult>(IQuery<TResult> query, IExecutionContext executionContext)
Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteAsync<TResult>(IQuery<TResult> query)
@HeyJoel HeyJoel added this to the Backlog milestone Mar 14, 2021
@HeyJoel
Copy link
Member

HeyJoel commented Mar 14, 2021

We should be able to catch the error and redirect to the 403 custom error page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants