Re: Check Current User is a Domaingroup member
From: Tim B (tbb_at_uni.de)
Date: 05/24/04
- Previous message: eliraz: "decrypt with a symmetric algorithm"
- In reply to: Eric Marvets: "Re: Check Current User is a Domaingroup member"
- Next in thread: Eric Marvets: "Re: Check Current User is a Domaingroup member"
- Reply: Eric Marvets: "Re: Check Current User is a Domaingroup member"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 24 May 2004 00:35:25 -0700
Hello
thx
it works, but when i have a computer which has the same name like my
dom an there is the same local group can i avoid the security??
bye
tim
"Eric Marvets" <ericm@bangproject.com> wrote in message news:<#HH9huPQEHA.2132@TK2MSFTNGP11.phx.gbl>...
> Here is what you do:
>
>
> At the start of the application (Shared Sub Main):
>
> Dim ident as WindowsIdentity = WindowsIdentity.GetCurrent()
> Dim prin As New WindowsPrincipal(ident)
>
> System.Threading.Thread.CurrentPrincipal = prin
>
> If not prin.IsInRole("dom\role") then
> 'throw an exception
> 'shutdown app
> end if
>
> 'launch main form
> End Sub
>
>
> This also allows you to place attributes on methods to check their security
> Level later in the application as well:
>
> <PrincipalPermissionAttribute(SecurityAction.Demand, Role :=
> "dom\ProductAdministrator")> Public sub CreateProduct (....)
>
> End Sub
>
> -or-
>
> If
> System.Threading.Thread.CurrentPrincipal.IsInRole("dom\ProductAdministrator"
> ) then CreateProduct(....)
>
>
> --
> Eric Marvets
> Principal Consultant
>
> the bang project
>
> <shameless self promotion>
>
> Email sales@bangproject.com for Information on Our Architecture and
> Mentoring Services
>
> </shameless self promotion>
- Previous message: eliraz: "decrypt with a symmetric algorithm"
- In reply to: Eric Marvets: "Re: Check Current User is a Domaingroup member"
- Next in thread: Eric Marvets: "Re: Check Current User is a Domaingroup member"
- Reply: Eric Marvets: "Re: Check Current User is a Domaingroup member"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|