Added isPublic() hook for secure pagefiles to work. Added more checks to see if template based access control should be used instead.