Re: Check calling users group membership

From: MS Newsgroups (lindblom_niclas_at_hotmail.com)
Date: 07/26/03


Date: Sat, 26 Jul 2003 19:38:36 +0100


Where should i put this statement to get it to execute before the class is
called ?

 <PrincipalPermission(SecurityAction.Demand, Role:="mydomain\My
ApplicationsGroup")> _
  Public class Form1

"Ivan Medvedev [MS]" <ivanmed@online.microsoft.com> wrote in message
news:Ooj2vBvUDHA.3220@tk2msftngp13.phx.gbl...
> Niclas -
> you have to do this first:
>
>
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
> Hope this helps.
> --Ivan
>
> This message is provided "AS IS" with no warranties, and confers no
rights.
>
>
> "MS Newsgroups" <lindblom_niclas@hotmail.com> wrote in message
> news:u27UICuUDHA.624@TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > I have been trying to figure out how to check that a users is a member
of
> a
> > certain group when a form is loaded (I am using VB .net) to filter what
> > users are allowed to use a application by Active Directory group
> membership.
> > I have found some samples that uses
> >
> > <PrincipalPermission(SecurityAction.Demand, Role:="mydomain\My
> Applications
> > Group")> _
> > Public class Form1
> >
> >
> > but i can not get this to work. Can someone please post a sample showing
> > what the correct way of doing this is ?
> >
> > Many thanks
> >
> > Niclas
> >
> >
> >
> >
>
>