Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Validate user permissions

Validate user permissions

Scheduled Pinned Locked Moved C#
csharpquestionannouncementwindows-adminsecurity
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thedan
    wrote on last edited by
    #1

    View a printable version of this message! I'm working on building a web-based solution (c# + .net) to allow users to manage AD groups that they have appropriate rights to manage. On all groups in Active Directory, there is an advanced permission called "Write Members". If the user (who logged in via a forms based login page) is granted that permission on the group (either directly or by being a member of a group that has been granted the necessary permission), they should be able to update the group membership. The web app has its own user account with enough permissions to update the group, but I don't know the best way of having it determine if it should use it's powers to update the membership for the user. My question: What is the best way to handle this, and is there a way for me to just pass the user DN (or SID, SAMAccountName, etc), and have AD determine if it that user is allowed to access that object. I've found code that should be able to get the user's security token, and parse the SIDs it contains. I'm assuming I could then take that list of SIDs, and compare it to the list of users/groups that have Write Members set to allow on the group in question. This seems ugly/wrong. There are too many cases where this falls short (i.e. the user is a member of a group that doesn't have the Write Members permission, but it does have the Write All Properties permission. It also doesn't effectively check for deny entries.) It feels like there should be a way for me to simply [programatically] ask AD if user X has access to update the "member" attribute on a given group. I am a Systems Engineer and not (yet) a programmer, so a little more verbose answer is very much appreciated. Thanks!

    D 1 Reply Last reply
    0
    • T Thedan

      View a printable version of this message! I'm working on building a web-based solution (c# + .net) to allow users to manage AD groups that they have appropriate rights to manage. On all groups in Active Directory, there is an advanced permission called "Write Members". If the user (who logged in via a forms based login page) is granted that permission on the group (either directly or by being a member of a group that has been granted the necessary permission), they should be able to update the group membership. The web app has its own user account with enough permissions to update the group, but I don't know the best way of having it determine if it should use it's powers to update the membership for the user. My question: What is the best way to handle this, and is there a way for me to just pass the user DN (or SID, SAMAccountName, etc), and have AD determine if it that user is allowed to access that object. I've found code that should be able to get the user's security token, and parse the SIDs it contains. I'm assuming I could then take that list of SIDs, and compare it to the list of users/groups that have Write Members set to allow on the group in question. This seems ugly/wrong. There are too many cases where this falls short (i.e. the user is a member of a group that doesn't have the Write Members permission, but it does have the Write All Properties permission. It also doesn't effectively check for deny entries.) It feels like there should be a way for me to simply [programatically] ask AD if user X has access to update the "member" attribute on a given group. I am a Systems Engineer and not (yet) a programmer, so a little more verbose answer is very much appreciated. Thanks!

      D Offline
      D Offline
      daniel abcde
      wrote on last edited by
      #2

      perhaps using LDAP ? My program can allow AD users to change their password by their own. I'm not sure does this works in your case. You can try.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups