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. Database & SysAdmin
  3. Database
  4. Security tree structure

Security tree structure

Scheduled Pinned Locked Moved Database
sharepointdata-structuressecurityquestion
4 Posts 4 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.
  • R Offline
    R Offline
    Rajeshwar Code Developer
    wrote on last edited by
    #1

    Hello brothers Just i m designing for helpdesk product. jsut think about . i have one department Department(Admin) . . ...... SupportTeams ( Support Teams having Support Users) . ........ SupportUser1 . ........ SupportUser2 and so.... User Team1(Means developer) , ......User1 . ..... User2 User Team2(Means developer) , ......User1 . ..... User2 Now my question is i want to give security for this tree structure. ..> Department Admin can access to all Like Support Teams and USer teams. ..> Support Teams can Access to Only Userteams Member. ..> Userteams Member can aceess only his profiles. Now can u tell me how could i create table for these flow tree structure.

    Some Thing need 2 do NEW

    I M 2 Replies Last reply
    0
    • R Rajeshwar Code Developer

      Hello brothers Just i m designing for helpdesk product. jsut think about . i have one department Department(Admin) . . ...... SupportTeams ( Support Teams having Support Users) . ........ SupportUser1 . ........ SupportUser2 and so.... User Team1(Means developer) , ......User1 . ..... User2 User Team2(Means developer) , ......User1 . ..... User2 Now my question is i want to give security for this tree structure. ..> Department Admin can access to all Like Support Teams and USer teams. ..> Support Teams can Access to Only Userteams Member. ..> Userteams Member can aceess only his profiles. Now can u tell me how could i create table for these flow tree structure.

      Some Thing need 2 do NEW

      I Offline
      I Offline
      infneeta
      wrote on last edited by
      #2

      What best you can do is to create one table like ID DepartMent DepartMentData and make DepartMentData column as xml type where you will store data in the hierarchal way. For eg. There is an admin department so the DepartMentData column may have values like <Department Name = "Admin"> ------<SupportTeams> ----------<SupportUser Name ="SupportUser1" ID="1"> --------------<DeveloperTeam1> ------------------<User Name ="Dev1User1" ID="1"/> ------------------<User Name ="Dev1User2" ID="2"/> --------------</DeveloperTeam1> ----------</SupportUser> ----------<SupportUser Name ="SupportUser2" ID="2"/> --------------<DeveloperTeam2>; ------------------<User Name ="Dev2User1" ID="1"/> ------------------<User Name ="Dev2User2" ID="2"/> ---------------</DeveloperTeam2> -----------</SupportUser> ------</SupportTeams> </Department > Now in C# code you could pass the element you want to read Like for eg. you want to read all the users below SupportTeams then you just need to call: XmlNodeList ChilNodes = doc.GetElementsByTagName("SupportTeams") This will return all the child nodes including SupportTeams node. Now you can iterate through for each node foreach (XmlNode cNode in ChilNodes ) { } In the loop check that each node has further any child node by calling: if(cNode.ChilNodes!= null) This way you could ensure that you have not gone to above in the tree hierarchy. This will always go to below in the tree hierarchy.

      1 Reply Last reply
      0
      • R Rajeshwar Code Developer

        Hello brothers Just i m designing for helpdesk product. jsut think about . i have one department Department(Admin) . . ...... SupportTeams ( Support Teams having Support Users) . ........ SupportUser1 . ........ SupportUser2 and so.... User Team1(Means developer) , ......User1 . ..... User2 User Team2(Means developer) , ......User1 . ..... User2 Now my question is i want to give security for this tree structure. ..> Department Admin can access to all Like Support Teams and USer teams. ..> Support Teams can Access to Only Userteams Member. ..> Userteams Member can aceess only his profiles. Now can u tell me how could i create table for these flow tree structure.

        Some Thing need 2 do NEW

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        If you are using SQL 2008 (you don't mention the database) look into the hierarchy ID and it's methods.

        Never underestimate the power of human stupidity RAH

        J 1 Reply Last reply
        0
        • M Mycroft Holmes

          If you are using SQL 2008 (you don't mention the database) look into the hierarchy ID and it's methods.

          Never underestimate the power of human stupidity RAH

          J Offline
          J Offline
          Jeremy Likness
          wrote on last edited by
          #4

          Right ... haven't looked in to the 2008 solution but in 2005 it's as simple as: ID SecurityName ParentID Then you can use hierarchal queries (recursive CTE or common table expressions) to unroll the tree. Example: http://www.eggheadcafe.com/articles/sql_server_recursion_with_clause.asp[^]

          Jeremy Likness Latest Article: Hierarchal Data Templates in Silverlight Blog: C#er : IMage

          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