mattbrailsford / umbraco-fluidity

A fluent CRUD user interface generator for Umbraco
https://our.umbraco.org/projects/backoffice-extensions/fluidity/
Apache License 2.0
48 stars 40 forks source link

Ability to hide folders on predicate. #113

Open Antoshjkee opened 5 years ago

Antoshjkee commented 5 years ago

Based on my question #111 Since change is so small, I have implemented the change before getting a reply.

Overall: The current feature allows hiding folders on a predicate during the config setup.

Example:

    treeConfig.AddFolder("Folder", folderConfig =>
    {
        folderConfig.HideFromTree(() =>
        {
            var currentUser = UmbracoContext.Current.Security.CurrentUser;
            if (currentUser == null) return false;
            return currentUser.IsAdmin();
        });

        // ... 
    }    
mattbrailsford commented 5 years ago

Hey @antoshjkee, thanks for submitting a PR. I'm currently away ATM, back next week, so will review properly then, but initial thought on the idea is that it's s good one.

Will come back with more in a few days.

Many thanks