Roles

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Groh

    Roles

    Hi folks,
    Having this code:

    if(User.IsInRol e("ConfiguredRo le")) {
    ApplyRule();
    }

    should it works right ? but doesn't with me...when i set User. (dot) i just
    have some properties and methods where the method IsInRole() is not
    showing...How do i do ?

    Thanks in advance

    Daniel


  • Dave

    #2
    Re: Roles

    You must cast "User" to "System.Securit y.Principal.Win dowsPrincipal" if you are using Windows authentication, otherwise it is
    probably assignable to "System.Securit y.Principal.Gen ericPrincipal".

    --
    Dave Sexton
    dave@www..jwaon line..com
    -----------------------------------------------------------------------
    "Daniel Groh" <newsgroupms@gm ail.com> wrote in message news:%23QFxncwZ FHA.3280@TK2MSF TNGP09.phx.gbl. ..[color=blue]
    > Hi folks,
    > Having this code:
    >
    > if(User.IsInRol e("ConfiguredRo le")) {
    > ApplyRule();
    > }
    >
    > should it works right ? but doesn't with me...when i set User. (dot) i just have some properties and methods where the method
    > IsInRole() is not showing...How do i do ?
    >
    > Thanks in advance
    >
    > Daniel
    >[/color]


    Comment

    Working...