Re: Role based security on local machine

From: Nicole Calinoiu (calinoiu)
Date: 05/02/05

  • Next message: Sushant Bhatia: "System.ExecutionEngineException for certificate object creation"
    Date: Mon, 2 May 2005 09:51:52 -0400
    
    

    Why would this work? (I'm just seeing the value labels returned.)

    "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
    wrote in message news:327141632503932663723712@news.microsoft.com...
    > Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,
    >
    >
    > or just do
    > WindowsBuiltInRole.Administrator.ToString();
    >
    > :)
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    >> How exactly would you use the WindowsBuiltInRole enum when defining a
    >> PrincipalPermission, gvein that only strings are accepted for
    >> identifying the roles? I know that I've seen a localization-safe
    >> version of the names quite recently (in an article with a very
    >> convenient table for mapping the various name formats), but I couldn't
    >> find it when I went looking earlier this morning...
    >>
    >> "Dominick Baier [DevelopMentor]"
    >> <dbaier@pleasepleasenospamdevelop.com> wrote in message
    >> news:327075632503869594434528@news.microsoft.com...
    >>
    >>> Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,
    >>>
    >>> or even better - use the WindowsBuiltInRole Enum - Builtin groups are
    >>> localized and that is a major PITA!!
    >>>
    >>> BUILTIN\Administrator == VORDEFINIERT\Administrator (german)
    >>>
    >>> ---------------------------------------
    >>> Dominick Baier - DevelopMentor
    >>> http://www.leastprivilege.com
    >>>> Is the "MACHINENAME" from your sample code the name of the local
    >>>> machine or another machine on the network? If it's the local
    >>>> machine, try using the "BUILTIN\Administrators" syntax instead. If
    >>>> it's not the local machine, is it possible that your local account
    >>>> doesn't have permissions to access the target machine at all?
    >>>>
    >>>> "Diane" <dweaver@hcd.net> wrote in message
    >>>> news:1114774743.636573.247460@o13g2000cwo.googlegroups.com...
    >>>>> I am testing role based security and have a problem when logged
    >>>>> into the local machine. It always fails when I specify a group
    >>>>> instead of a user name. Everything works fine when I'm logged into
    >>>>> the domain. I'm running it on an XP machine. Following is the
    >>>>> code:
    >>>>>
    >>>>> Dim currentDomain As AppDomain = AppDomain.CurrentDomain
    >>>>>
    >>>>> currentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
    >>>>>
    >>>>> Dim myIdentity As WindowsIdentity = WindowsIdentity.GetCurrent Dim
    >>>>> myPrincipal As New WindowsPrincipal(myIdentity)
    >>>>> Thread.CurrentPrincipal = myPrincipal
    >>>>>
    >>>>> Dim myPermission As New PrincipalPermission(Nothing,
    >>>>> "MACHINENAME\Administrators")
    >>>>>
    >>>>> Try
    >>>>> myPermission.Demand()
    >>>>> MessageBox.Show("Welcome to the show! You have access!")
    >>>>> Catch ex As Exception
    >>>>> MessageBox.Show("Get out of here! You don't have access!")
    >>>>> MessageBox.Show(ex.Message)
    >>>>> End Try
    >
    >
    >


  • Next message: Sushant Bhatia: "System.ExecutionEngineException for certificate object creation"

    Relevant Pages

    • Re: Role based security on local machine
      ... > Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com, ... gvein that only strings are accepted for ...
      (microsoft.public.dotnet.security)
    • Re: Role based security on local machine
      ... > Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com, ...
      (microsoft.public.dotnet.security)
    • Re: Opening a local file in a browser
      ... "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message ... > trustworthy to merit this. ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Role based security on local machine
      ... Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com, ... sorry - i though of IsInRole... ... I know that I've seen a localization-safe ...
      (microsoft.public.dotnet.security)
    • Re: Changing folder security
      ... Maybe you know which Windows API should i use ... "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message ...
      (microsoft.public.dotnet.security)