Hi
As far as I know you will need to load the page to check the access rights. Notice however that in the R2 release the GetPage call will always return the page, regardless of the access rights.
I would probobly do something like this:
new FilterAccess.ShouldFilter(GetPage(new PageReference(pageId))) &&
new FilterPublished.ShouldFilter(GetPage(new PageReference(pageId)));
You would still need to catch PageNotFoundExcption though.
Howver when I looked at your sample it seems like you are using EPiServer 4. In that case I don't really know any more elegant solution.
Regards
Per Gunsarfs
EPiServer CMS development team.
In CMS 5 R2 the Page providers interface do not have any methods for this. Therfore there will be no generic method. But if you look at the DataAccess namespace you wil find some quick methods too get some info.
PageAclDB db=new EPiServer.DataAccess.PageAclDB() ;
DataSet ds = db.List(new PageReference(3));
Its a bit hardcore and you need to convert form DataSet tol acl but its maybe quicker.
I even guess you can make your own version of this where you can check more than one pagereference (use Refletor). EPiServer always read only one page at the time and that have a big impact on preformance in cms 4. CMS 5 is a lot better but thats cause of the cache.