cloudscribe/Announcements

breaking change in the navigation library

Opened this issue · 0 comments

As you may know the cloudscribe.Web.Navigation library allows filtering nodes by permission. When it was first implemented it only supported role checks and this did not require async, but later we added support for using authorization policy names to filter nodes and the IAuthorizationService uses async. Until now we have been just executing that synchronously which is not a great idea and was pointed out in this issue:
cloudscribe/cloudscribe.Web.Navigation#69

Specifically the changes are:
INavigationNodePermissionResolver ShouldAllowView method is now Task of bool instead of bool.
In addition the following methods on NavigationViewModel change from bool to Task of bool and must be awaited when invoked from the views:
ShouldAllowView
HasVisibleChildren

The views that ship in the navigation library have all been updated to await the async methods.

However if you have custom views in your project then you need to update them to await.

Note that at the time of this writing I have not yet updated cloudscribe core or simplecontent to use the new version of the navigation library, but I'm about to do that today. And then if you upgrade the nugets in your project any local views will need to be updated by adding the await keyword before invoking the async methods ShouldAllowView and HasVisibleChildren