473,326 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

is in group?

Hi guys

I'm using Windows Auth and want to check that the logged in user is part of
a specific group in order to limit access to some part of the site.

How do I do this?

Cheers
Dan
Nov 19 '05 #1
4 1406
You can use

Page.User.IsInRole(@"DomainName\GroupName");

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
Hi guys

I'm using Windows Auth and want to check that the logged in user is part ofa specific group in order to limit access to some part of the site.
How do I do this?

Cheers
Dan
.

Nov 19 '05 #2
Elton,

Thanks for that. Unfortunately it doesnt seem to work.

ive tried the following code..

if(Page.User.IsInRole(role))
btnNewProject.Disabled = false;
else
btnNewProject.Disabled = true;

Where role is "mydomain.com\TestGroup" and the logged in user is a member of
TestGroup. When I run the code, the button is always disabled! Am I missing
something?!

Cheers
Dan

"Elton Wang" wrote:
You can use

Page.User.IsInRole(@"DomainName\GroupName");

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
Hi guys

I'm using Windows Auth and want to check that the logged

in user is part of
a specific group in order to limit access to some part of

the site.

How do I do this?

Cheers
Dan
.

Nov 19 '05 #3
In order to use User object, you have to deny anonymous
access. Otherwise, it doesn't work.

HTH

Elton Wang
-----Original Message-----
Elton,

Thanks for that. Unfortunately it doesnt seem to work.

ive tried the following code..

if(Page.User.IsInRole(role))
btnNewProject.Disabled = false;
else
btnNewProject.Disabled = true;

Where role is "mydomain.com\TestGroup" and the logged in user is a member ofTestGroup. When I run the code, the button is always disabled! Am I missingsomething?!

Cheers
Dan

"Elton Wang" wrote:
You can use

Page.User.IsInRole(@"DomainName\GroupName");

HTH

Elton Wang
el********@hotmail.com

>-----Original Message-----
>Hi guys
>
>I'm using Windows Auth and want to check that the
logged in user is part of
>a specific group in order to limit access to some part
of the site.
>
>How do I do this?
>
>Cheers
>
>
>Dan
>.
>

.

Nov 19 '05 #4
Hello Elton,

Your statement is incorrect. I think what you meant to say was:

In order to use the User object to retrieve Active Directory roles, anonymous
access must be disabled. You can absolutely use the User object when using
anonymous access (ie: FormsAuthentication).

--
Matt Berther
http://www.mattberther.com
In order to use User object, you have to deny anonymous access.
Otherwise, it doesn't work.

HTH

Elton Wang
-----Original Message-----
Elton,
Thanks for that. Unfortunately it doesnt seem to work.

ive tried the following code..

if(Page.User.IsInRole(role))
btnNewProject.Disabled = false;
else
btnNewProject.Disabled = true;
Where role is "mydomain.com\TestGroup" and the logged in

user is a member of
TestGroup. When I run the code, the button is always

disabled! Am I missing
something?!

Cheers

Dan

"Elton Wang" wrote:
You can use

Page.User.IsInRole(@"DomainName\GroupName");

HTH

Elton Wang
el********@hotmail.com
-----Original Message-----
Hi guys
I'm using Windows Auth and want to check that the
logged
in user is part of

a specific group in order to limit access to some part
of
the site.

How do I do this?

Cheers

Dan
.

.

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
2
by: Tom Loach | last post by:
Our system administrator set up an NT server group in order to allow our users to login to our application via https to our sql server. The group appears as a User in SQL Server when you look at...
4
by: Chad Richardson | last post by:
I've always been mistified why you can't use a column alias in the group by clause (i.e. you have to re-iterate the entire expression in the group by clause after having already done it once in the...
2
by: BillD | last post by:
I'm trying to derive a schema from a base schema. I want to redefine a "group" from the base schema in my derived schema in order to add more options to the "choice" aggregate (see schema1.xsd...
16
by: michael | last post by:
Is it possible to get all href URLs contained in a unordered list and place them in an array? Or in fact two different arrays, differently named one for each <ul> group? <ul> <li><a...
7
by: Darin | last post by:
I have a report that sub-totals on a group, then grand-totals at the report footer. If there's only one group, the sub-total and grand total are redundant, so I only want to show one of them. I...
1
by: David Horowitz | last post by:
Hi folks. I need to create a report that has a Group Header that pulls certain data from the Detail section. It's something like this: +--Report---------------------------------------- |...
7
by: Sameh Ahmed | last post by:
Hello there IsInrole gives ya the means to check if the current or impersonated user belongs to a specific windows role or group. is there a way to do the same without using ADSI to check if...
2
by: jon|k | last post by:
hi all-- i need to do a transformation that removes duplicates (among other things). to accomplish that, i'm trying to use for-each-group, but it doesn't work. i need to select for duplicates by...
3
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.