문제

I am developing a Windows Forms application in C#. I have created user authentication within this application, and I have to restrict access to different functionalities to users depending on their permissions.

Is there a framework that can help me with that?

도움이 되었습니까?

해결책

One of many options:

Unify Windows Forms and ASP.NET Providers for Credentials Management

Possibly the simplest solution is to use Windows role authentication along with database schema to represent what access roles have. The precise implementation depends on your requirements.

다른 팁

Is your application going to run in a Microsoft Domain? (Will your users log into a domain using active directory?)

If so then you can employ the .Net Frameworks System.Security namespace to manage access quite easily.

Here is a Channel 9 overview of System.Security and the MSDN Overview of System.Security.

If you are not on a domain, it is generally not too difficult to validate what ever credentials are available and marshal them into a custom IIdentity & IPrinicipal object that will meet your needs.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top