I normally in my projects use such these code:
If user.IsInRole('Admin') Then deleteButton.Visible = True else deleteButton.Visible = False
But I want to control roles, which can see this button in database.
For this purpose how should database design be?
Thanks.
Assuming you’re using .NET, one way to do this is to implement your own Role and Membership Providers. Then, you could add functionality by implementing an interface that contained the items you wanted (I’ve just knocked this sample up off the top of my head, so I apologize if it seems a bit rough):
Then, in your code you would do this: