1
Answer

Manage User Group and Permission

meat meat

meat meat

13y
11.3k
1
Hi !
I want to manager user group and permission.
I have saved user , user group and permission in database.
How do i avoid using constant to check for group or permission?
I want it that constant id can be loaded from the database or a different way that is more configurable from the database.\
so i only need to change the group and permission in the database

Here is my sample code . As you can see it use a constant field to check for group
 public static bool AllowToViewSales()
        {
            return UserManager.GetCurrentUser().CanViewSales(Constants.UserGroup.Id.Sales);
        }

Thanks

Answers (1)