Giter Club home page Giter Club logo

Comments (6)

cihangll avatar cihangll commented on September 23, 2024 1

Hi @wakuflair,
I think we don't need Permission field. We already know the group and setting name at runtime. We can implement this as default behaviour. If user define permission like SettingUiPermissions.Tenant.GroupName.SettingName we can automatically check this at runtime. If user dont define this permission we can pass and show specified setting on the UI.

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

image

from abp.settingui.

cihangll avatar cihangll commented on September 23, 2024 1

I can PR for this. :)

from abp.settingui.

wakuflair avatar wakuflair commented on September 23, 2024 1

Sure, I will look at it ASAP.

from abp.settingui.

wakuflair avatar wakuflair commented on September 23, 2024

Sounds a good idea!

I will take a closer look, thank you @cihangll 😄

from abp.settingui.

cihangll avatar cihangll commented on September 23, 2024

Hi @wakuflair ,
Can you check this PR for this?

from abp.settingui.

wakuflair avatar wakuflair commented on September 23, 2024

Resolved with #46

from abp.settingui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.