1
Reply

Manage User Group and Permission

meat meat

meat meat

Nov 17 2010 5:10 AM
11.3k
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)