I have a small query.
I want to create user level authentication for a desktop application. Thats means, if: 1. Admin logs in, Admin get to see all options of the app 2. If user logs in, User gets to see only few details
My problem is I dont want to do this using a dropdown and choosing the User Type. I want to store the details in the database and once the user logs in, the new display window should show its contents according to the use type, i.e. Admin or User.
How can this be achieved. I am creating a Desktop application using C#.net.
Any help is appreciated.
Regards, GenXCoders
In the desktop program:
using System.Security.Principal;
....
string adLogon = WindowsIdentity.GetCurrent().Name;
That will get you the current user.
In the database, something like:
create table Users (
ADLogon nvarchar(50), -- PK
IsAdmin bit -- in SQL Server this is the boolean type
)
Lookup the current user is the database, get their permission level.