Search for Users who have access to a specific page



 Given a page reference, what would be the best way to search for users who have access to that page?

 Many thanks


#27912 Feb 12, 2009 16:40
  • Member since: 1996
    Something like this might work, havent tested it thoroughly though:


    AccessLevel requestedLevel = AccessLevel.Publish; 

    PageData pd = DataFactory.Instance.GetPage(PageReference.StartPage);

    HashSet<string> users = new HashSet<string>();


    foreach( string key in pd.ACL.Keys )


    AccessControlEntry ace = pd.ACL[key];

    if(0 == (ace.Access & requestedLevel))





    foreach(string user in Roles.GetUsersInRole(ace.Name))



    else users.Add(ace.Name);


    #27913 Feb 12, 2009 17:28

    It would, except I'm reusing the Workrooms demo template which assigns access right for a user directly on the page (ie it's not based on a role)

    Many thanks


    #27914 Feb 12, 2009 18:10
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
Please login to post a reply