You are viewing limited content. For full access, please sign in.

Question

Question

Obtain a list of folders that have non-inherited permssions

asked on November 9, 2017

I need to get a list of folders that have non-inherited permissions using the SDK.  Is there a way to do this?

0 0

Replies

replied on November 9, 2017

10.2 introduce the LFACE search type, you can use this search to find all folders with any security assigned: {LF:Name="*", Type="F"} & {LFACE:type="*"}. More information on the LFACE search prefix can be found here.

1 0
replied on November 9, 2017

To do this prior to 10.2, use a search and check the access rights on each row of the results:

using (Search search = new Search(session, @"({LF:Name~=""*"", Type=""F""})"))
{
    search.Run();

    SearchListingSettings settings = new SearchListingSettings();
    settings.AddColumn(SystemColumn.Id);
    settings.SortColumn = new ColumnSpecifier(SystemColumn.Id);

    using (SearchResultListing listing = search.GetResultListing(settings))
    {
        foreach (EntryListingRow row in listing)
        {
            int entryId = (int)row[SystemColumn.Id];
            EntryInfo en = Entry.GetEntryInfo(entryId, session);

            EntrySecurity entrySec = en.GetAccessControl();
            AccessRuleCollection aces = entrySec.GetAccessRules(true, false);

            if (aces.Count > 0)
                Console.WriteLine(String.Format("{0} has rights assigned", en.Path));
        }
    }
}

 

0 0
replied on November 16, 2023

Robert, is there a way to utilize this to search for all folders that have the "Inherit rights from parent and include with specific rights" box unchecked?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.