-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add "permission" to the setting property #43
Comments
Hi @wakuflair, For example, we have 2 different groups and 4 different setting for each group. We can write like this. (spaghetti code) var moduleGroup = context.AddGroup(SettingUiPermissions.GroupName, L("Permission:SettingUi"));
var root = moduleGroup.AddPermission(SettingUiPermissions.Tenant, L("Permission:SettingUi.Tenant"));
var group1 = root.AddChild(SettingUiPermissions.Tenant + ".Group1", L("Permission:SettingUi.Tenant.Group1"));
group1.AddChild(SettingUiPermissions.Tenant + ".Group1" + ".Setting1"); // If the user has this permission, show the specified setting
//group1.AddChild(SettingUiPermissions.Tenant + ".Group1" + ".Setting2"); always show
//group1.AddChild(SettingUiPermissions.Tenant + ".Group1" + ".Setting3"); always show
group1.AddChild(SettingUiPermissions.Tenant + ".Group1" + ".Setting4"); // If the user has this permission, show the specified setting
var group2 = root.AddChild(SettingUiPermissions.Tenant + ".Group2", L("Permission:SettingUi.Tenant.Group2"));
//group2.AddChild(SettingUiPermissions.Tenant + ".Group2" + ".Setting1"); always show
//group2.AddChild(SettingUiPermissions.Tenant + ".Group2" + ".Setting2"); always show
//group2.AddChild(SettingUiPermissions.Tenant + ".Group2" + ".Setting3"); always show
group2.AddChild(SettingUiPermissions.Tenant + ".Group2" + ".Setting4");// If the user has this permission, show the specified setting |
Sounds a good idea! I will take a closer look, thank you @cihangll 😄 |
I can PR for this. :) |
Hi @wakuflair , |
Sure, I will look at it ASAP. |
Resolved with #46 |
see #40 (comment)
The text was updated successfully, but these errors were encountered: