Displaying Left Navigation Menu Based on Multiple Permissions #7188
Replies: 3 comments
-
Hi @EdwinThomas11, This may be too simplistic for you, and there may be a better "native Serenity" approach that I just don't know but... what if you created a third permission specific to that item? Rather than expecting users to manage this permission, you can transparently assess a user's right to that permission based on having at least one of the other two, during a Save Response. (Being a SQL person, I'd just call a stored procedure to synch it up as part of the Save, but you might prefer to do it in the CS) Another way would be to leave the navigation link attribute as you currently have it, supporting 1 of the two permissions natively but in navigation CS add it back in explicitly, if they have only the 2nd permission and not the first. Interesting question, and I'll be interested to hear what you end up doing :-). I am sure I will learn something! |
Beta Was this translation helpful? Give feedback.
-
Hi @LSNicholls , Thanks for the suggestion. However, I've handled this through the NavigationModel.cs file. |
Beta Was this translation helpful? Give feedback.
-
Hi @EdwinThomas11, Thanks for letting me know what you decided to do! I have done some things through the Navigation*.cs files too, but have not found it easy to change the files in a way that is repeatable and/or extensible, it has all be "one-offs". Luckily Serenity has lots of different ways to do things, to suit different kinds of developers :-). |
Beta Was this translation helpful? Give feedback.
-
Hello,
I need to display the left navigation menu based on two permissions.
For example: If the user has either "Permission1" or "Permission2", I need to show the menu in the left navigation.
Currently, I am using the following code, but it supports only one permission:
[assembly: NavigationLink(int.MaxValue, "My Page", "~/MyUrl", "Permission1")]
I cannot handle this via myRow.cs file as the menu("~/MyUrl") will navigate to a different site.
Please help here. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions