Professional Web Applications Themes

isInrole - ASP.NET Security

I am using isInRole function to check if a user is in a group. It works ok except it will suddenly stop working and I will have to reboot to get it to work again. Any ideas?...

  1. #1

    Default isInrole

    I am using isInRole function to check if a user is in a
    group. It works ok except it will suddenly stop working
    and I will have to reboot to get it to work again. Any
    ideas?
    Dennis Storm Guest

  2. #2

    Default Re: isInrole

    Hi,

    If you make any changes in the user's membership i.e add or delete him from
    some groups you will need to relogin to the workstation. This is incase your
    application is a Win Forms based. For instance:

    I belong to groupA,groupB,groupC

    IsUserInRole("groupA") returns True

    Now I remove myself from groupA and now I belong to only groupB,groupC. I do
    not re-login to my workstation

    IsUserInRole("groupA") returns True

    Now I relogin in my workstation

    IsUserInRole("groupA") return False

    Also the IsUserInRole case sensitive. Take care of that also.

    Hope this would help

    Thanks
    Nakul








    "Dennis Storm" <hnj0251mail.drms.dla.mil> wrote in message
    news:0a4a01c3cfca$e9de9dd0$a601280aphx.gbl...
    > I am using isInRole function to check if a user is in a
    > group. It works ok except it will suddenly stop working
    > and I will have to reboot to get it to work again. Any
    > ideas?

    Nakul Guest

  3. #3

    Default isInRole

    Hi All,

    I am developing a A webpage to be seen in a page viewer
    webpart(Sharepoint 2003).The page is supposed to check for the current
    user name and then check the user membership in some local group
    membership.But here I am failing .The isinRole call on the Principal
    object is returning true
    for buitin groups and some local groups but not ALL.
    I read in one of the previous threads that this was a bug in Framework
    1 in which all groups are not retrieved.

    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;q321562[/url]

    SP3 takes care of it.
    However I have Framework 1.1 ...So the patches are not working...
    Can anyone tell me if this bug is fixed in v1.1?
    The code I am using is here is something like this
    HttpContext.Current.User.IsInRole("<machinename>\< group name>")
    I have tried all combo of group names even the case sensitive ones....

    Please do point out if something is amiss?
    My box is in an active directory domain.The configuration of my box is
    :Windows Server 2003,.net Framework v1.1,Windows SharePoint Services
    2.0,SharePoint Portal Server 2003


    Thanks in Advance,
    Arjun
    arjun Guest

Similar Threads

  1. WindowsPrincipal.IsInRole() is Being Flaky. Help!!
    By David Jessee in forum ASP.NET Security
    Replies: 3
    Last Post: March 11th, 03:16 AM
  2. isinrole reverts to windowsprincipal?
    By Vic in forum ASP.NET Security
    Replies: 0
    Last Post: November 26th, 09:14 PM
  3. Problems with IsInRole
    By John Rusk in forum ASP.NET Security
    Replies: 4
    Last Post: November 18th, 03:08 AM
  4. Help with IsInRole
    By Chris in forum ASP.NET Security
    Replies: 2
    Last Post: September 21st, 01:59 PM
  5. Webservice IsInRole and LDAP to AD
    By Harold in forum ASP.NET Security
    Replies: 3
    Last Post: August 20th, 02:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139