C# WinForms User/Permission management

2019-01-22 00:36发布

问题:

Can anyone provide me an example WinForms application that implements the concept of User authentication and authorization one the basis of Roles or Groups?

The application should allow access of users to the main-menu on the basis of their roles.

回答1:

If you are building the menu from a database table, you can security trim it by joining it to another table or view that excludes records on the basis of the permissions set.

The diagram below illustrates the basics of setting up role permissions for users, and contains a couple of other tables for security trimming individual controls on the form as well.

Controls Based Security in a Windows Forms Application
http://www.simple-talk.com/dotnet/windows-forms/controls-based-security-in-a-windows-forms-application/
.