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

Show parent MenuItems based on child permissions #477

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Show parent MenuItems based on child permissions #477

wants to merge 1 commit into from

Conversation

andrehaupt
Copy link

The proposed code allow parent MenuItems to be shown/hidden based on the permissions of the child items. At persent, if a user does not have access to any child MenuItems, the empty parent will always show (unless a specific permission is assigned to the parent element). With the proposed code, if the parent permissionName is 'Auto', the parent display state will be infered from the child items.

The proposed code allow parent MenuItems to be shown/hidden based on the permissions of the child items. At persent, if a user does not have access to any child MenuItems, the empty parent will always show (unless a specific permission is assigned to the parent element). With the proposed code, if the parent permissionName is 'Auto', the parent display state will be infered from the child items.
@ismcagdas
Copy link
Member

@andrehaupt thank you for your contribution. What about using empty string instead of Auto text ?

@andrehaupt
Copy link
Author

@andrehaupt thank you for your contribution. What about using empty string instead of Auto text ?

That's the way I had it originally, but I thought it would then always hide the parent if the user did not have access to any of the child elements. I guess this is ok though.

Let me know if I should resubmit.

(Loving the projet by the way. Thanks for doing this.)

@ismcagdas
Copy link
Member

Thanks 😄 . I think it is better to use menuItem.permissionName === '' instead of menuItem.permissionName === 'Auto'. But it is something minor. If you can change that, I will merge the PR and it can be released with the next version.

Thanks again.

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