Re: Check calling users group membership

From: Ivan Medvedev [MS] (ivanmed_at_online.microsoft.com)
Date: 07/28/03


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
> > >
> > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: So leaky that a $4 billion industry was built to protect it
    ... The owner can read and write and execute the file. ... this is similar to the "limited user rights" concept. ... Windoze on the other hand doesn't have this kind of security. ... Can't happen on a Linux system. ...
    (microsoft.public.windowsxp.general)
  • Re: VC .Net not mature?
    ... Normally, it does not allow LAN rights, like opening files on a LAN, ... or execute directly from a LAN network folder. ... Unrestricted=true)] // Request complete File IO functionality ... Microsoft .NET Framework 1.1 Configuration ...
    (microsoft.public.dotnet.languages.vc)
  • Re: VSFTP
    ... I have a Windows based server running on an XP machine. ... would be able to execute scripts or other executables from within their ... The server I speak of is the latest version of Serv-U FTP on the XP box, ... Here is a copy of the "Rights" section of the Serv-U help file. ...
    (linux.redhat.misc)
  • Re: SQL Server 2005 Stored Procedure security annoyances
    ... Can you grant an EXECUTE permission on stored procedure? ... I have came to the maturity level to stop using the sa account when I ... I mean it is unrealistic to have to manually set for each SP the rights ...
    (microsoft.public.sqlserver.security)
  • Re: File Execution Privileges
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Limited user navigates with explorer to the appropriate ... > executable file and tries to execute it. ... Windows XP generates a generic Error Message dialog box ...
    (microsoft.public.windowsxp.security_admin)