Create a role and check it

M

Magnus

Hello!

I 'm quite new to asp.net and trying to accomplish a web that gives 'admins'
some extra options in an aspx page.
I have a local group called admins at the dotnet server. In this group I
have domain users/groups.
I have this "code" in the web.config:
<authentication mode="Windows"/>

<identity impersonate="true"/>

If the user is a member of the local group myserver\admins something should
happend. Otherwise not!
How do I accomplish this? Please explain to a "dummie".

Regards Magnus
 
D

Dominick Baier

You can check for the role using Page/Context.User.IsInrole("admins") or
use the <authorization> element in web.config to declaratively restrict access
to pages and directories using roles. The site map feature is also role aware.

What else should happen? ;)


Why do you have a <impersonate> element in config - you can remove that if
you are not sure if you need it.
 
M

Magnus

Thank you. It worked perfectly!!!

Well, from the beginning I thought of using impersonate because the user
should use a database with his/her own account. Changed it to use one common
sql account instead, so that's true, I don't need impersonate anymore.
Does that make any sence to you?

Regards Magnus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top