You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Pages should use basically the same filter types as controllers, but should expose some unique functionality in place of action filters. In general a pages developer will want to accomplish the same kinds of things with filters as a controller/action developer.
This includes:
authorization (authZ filters)
middleware-like behavior (resource filters)
scoped exception handling (exception filters)
decorating the execution of results (result filters)
manipulating action arguments (action filters)
We'll want to provide a little something extra for pages, likely to do with manipulating handler methods 👍
There's a lot more to do here, because designing a new filter type, we need to decide how filters get configured when you have a mix of pages/page-models/handler-methods/application-model.
Is there an example of how to use this? I was using RazorPagesOptions.AuthorizeFolder for force authorization on pages but now thats not supported in the final release. Thanks.
@sketchpunk we moved the methods to hang off RazorPagesOptions.Conventions. You should be able able to options.Conventions.AuthorizeFolder(..). Additionally, applying the Authorize on page model is also supported now.
@pranavkm thanks man, been looking all day and couldn't find where the methods moved to or what replaced them. Just one more question, I dont use a page model, but I do use the inline model. I added "using Microsoft.AspNetCore.Authorization" to my razor page and tried putting Authorize on OnGet but it doesn't do anything but it compiles just fine. Not sure if even meant to work in the inline model. Thanks for your help.
Pages should use basically the same filter types as controllers, but should expose some unique functionality in place of action filters. In general a pages developer will want to accomplish the same kinds of things with filters as a controller/action developer.
This includes:
We'll want to provide a little something extra for pages, likely to do with manipulating handler methods 👍
There's a lot more to do here, because designing a new filter type, we need to decide how filters get configured when you have a mix of pages/page-models/handler-methods/application-model.
Related items:
The text was updated successfully, but these errors were encountered: