Re: Check calling users group membership
From: Ivan Medvedev [MS] (ivanmed_at_online.microsoft.com)
Date: 07/28/03
- Next message: Ivan Medvedev [MS]: "Re: Unverifiable Assembly (w/3rd party .dll and .lib)"
- Previous message: Pieter Philippaerts: "Re: Programatic reboot"
- In reply to: MS Newsgroups: "Re: Check calling users group membership"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 28 Jul 2003 10:02:11 -0700
This statement should be executed before any method of the protected class
is invoked. In your case it should be somewhere before Class1 is
instantiated.
--Ivan
This message is provided "AS IS" with no warranties, and confers no rights.
"MS Newsgroups" <lindblom_niclas@hotmail.com> wrote in message
news:OjobhU6UDHA.2320@TK2MSFTNGP12.phx.gbl...
> 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
> > >
> > >
> > >
> > >
> >
> >
>
>
- Next message: Ivan Medvedev [MS]: "Re: Unverifiable Assembly (w/3rd party .dll and .lib)"
- Previous message: Pieter Philippaerts: "Re: Programatic reboot"
- In reply to: MS Newsgroups: "Re: Check calling users group membership"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|