I need to find out if a group has permission on Folder and Documents but it should only return Top folder where it has permission. I am doing this in SQL
Ex:-
1. If There is a folder structure Folder_A-->Folder_B-->Folder_C and A group "GroupH" is applied to all down to tail From Folder_A to Folder C, it should only return Folder_A with Group Name
2. If Any document reside another location in CS and has perticularly this group permision (doesn't inherit from any where), that should also be display
I have created a query which list all the data but not sure how to filter this.
----------------------------------------------------
select distinct D.Name,DA.DataID,DTA1.AncestorID,DTA1.AncestorID
from
awcs.DTreeACL DA,
awcs.DTree D,
awcs.DTreeAncestors DTA,
awcs.DTreeAncestors DTA1
where DTA.DataID=DA.DataID and DTA.DataID=D.DataID and DA.RightID=<GroupID>and DA.DataID=DTA1.AncestorID
order by Name