Search:
Namespaces
Discussions
.NET v1.1
Feedback
Authentication
Messages
Related Types
This message was discovered on
ASPFriends.com 'winforms-cs' list
.
Morkai Kurst
Can you use windows authentication in winforms like you can in webforms?
Basically depending on who the logged in user is hide/view certain parts
of a form.
For instance on a stock information form, I would like to make the form
an all in one job so it can be used for editing. A button would put it
in 'edit/create new' mode and perhaps an extra couple of tab pages for
setting additional information. However I don't want every user having
access to these parts, more preferable would be for them not to even be
visable on the form.
We work on a Win2k SBS and everyone has to login to the system, I know I
can get the username with
System.Windows.Forms.
SystemInformation
.UserName, how would I go about
giving roles to people and using that to make certain controls
invisable? For my website I used a cookie and a database with username
and an admin or guest role which I checked to make certain links appear.
I'm not sure how to translate this functionality to a windows app.
Thanks for any pointers
Morkai
Reply to this message...
Scott Berry
It'd be pretty much the same: you could still store the role data in a
database, and you could check whether a certain action's allowed and set
the Visible/Enabled properties of controls based on that. =20
-Scott
This posting is provided "AS IS" with no warranties, and confers no
rights.
-----Original Message-----
From: Morkai Kurst [mailto:
Click here to reveal e-mail address
]=20
Sent: Thursday, May 09, 2002 4:49 PM
To: winforms-cs
Subject: [winforms-cs] Authentication
Can you use windows authentication in winforms like you can in webforms?
Basically depending on who the logged in user is hide/view certain parts
of a form.=20
For instance on a stock information form, I would like to make the form
an all in one job so it can be used for editing. A button would put it
in 'edit/create new' mode and perhaps an extra couple of tab pages for
setting additional information. However I don't want every user having
access to these parts, more preferable would be for them not to even be
visable on the form.
We work on a Win2k SBS and everyone has to login to the system, I know I
can get the username with
System.Windows.Forms.
SystemInformation
.UserName, how would I go about
giving roles to people and using that to make certain controls
invisable? For my website I used a cookie and a database with username
and an admin or guest role which I checked to make certain links appear.
I'm not sure how to translate this functionality to a windows app.
Thanks for any pointers
Morkai
| [winforms-cs] member
Click here to reveal e-mail address
=3D YOUR ID
|
http://www.asplists.com/asplists/winforms-cs.asp
=3D JOIN/QUIT
Reply to this message...
Morkai Kurst
Ok, simple as that then, thanks. I wasn't sure if there was a built in
or better way of doing it.
Would it be considered better coding to store the users role somewhere
on application startup and use that on each check or would just hitting
the db and setting the role in a variable on each formload be okay? Our
company is only 10 people but I'm interested in what would be done where
an application was being written for a major company that might have
several hundred users.
If the former where would one store it?
Thankyou
Morkai
[Original message clipped]
Reply to this message...
Scott Berry
This is a personal preference thing: I'd think you'd either store it on
application startup or you'd check with each operation. It also has to
do with how much the permissions will change, how critical it will be
when it does, and how often users restart the application. If you
remove a privilege from an account, you might not want to allow the user
to perform actions they're not allowed to just because they already had
the form up. On the other hand, if you grant a permission, and the
person already has the application running, are they going to know that
they have to close the app down so that the app will find their new
permissions?
If you were to store it, you'd probably store it wherever you store the
username or whatever you have. If you look at your app top-down, you'd
normally have this about at the top: no point in having to pass this
information back up the chain from the bottom.
-Scott
This posting is provided "AS IS" with no warranties, and confers no
rights.
-----Original Message-----
From: Morkai Kurst [mailto:
Click here to reveal e-mail address
]=20
Sent: Saturday, May 11, 2002 4:15 PM
To: winforms-cs
Subject: [winforms-cs] RE: Authentication
Ok, simple as that then, thanks. I wasn't sure if there was a built in
or better way of doing it.
Would it be considered better coding to store the users role somewhere
on application startup and use that on each check or would just hitting
the db and setting the role in a variable on each formload be okay? Our
company is only 10 people but I'm interested in what would be done where
an application was being written for a major company that might have
several hundred users.
If the former where would one store it?
Thankyou
Morkai
[Original message clipped]
| [winforms-cs] member
Click here to reveal e-mail address
=3D YOUR ID
|
http://www.asplists.com/asplists/winforms-cs.asp
=3D JOIN/QUIT
Reply to this message...
System.Windows.Forms.SystemInformation
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com