Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querry a complete user list based on ACL (access controll list)

Status
Not open for further replies.

SenadSe

Programmer
Dec 2, 2011
28
BA
hi

I am trying to make a list of users based on the ACL (acces control list which is based on DTreeACL) for items like folders and so on.

Lets say, i have an Folder with the ID=11567 ('Customer Service' in this case).

This folder hes his ACL, the list of users and groups which have acces to it.
Now , i want a list of all users only. (including the users found in the groups of the ACL, and users in nested groups. (bcos groups can contain groups)).

I tryed fwe querries, i can post some examples. I cant manage to select the whole three of users.
Here comes the KUAFChildren table handy .
The KUAF table is the one containing the names i need in the end.

SO, do i need to use hierarchical querries?

here is an example i tryed :
Code:
WITH
  cteUserList ( GroupID, ChildID, EmpLevel)
  AS
  (
    SELECT ID, ChildID, 1
    FROM KUAFChildren
    WHERE ID = 11676
    UNION ALL
    SELECT kc.ID, kc.ChildID, 
      r.EmpLevel + 1
    FROM KUAFChildren kc
      INNER JOIN cteUserList r
        ON kc.ID = r.GroupID
  )
  SELECT
  GroupID 
  EmpLevel,
   (SELECT id FROM KUAFChildren 
    WHERE ID = cteUserList.ChildID) AS someTitleID
FROM cteUserList 
ORDER BY EmpLevel, ChildID
and this gives me this result:
'The statement terminated. The maximum recursion 100 has been exhausted before statement completion.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top