function isAttachmentAllowed(\PageAttachment\Session\Page $page)
 {
     $attachmentAllowed = false;
     $pageId = $page->getId();
     $pageNS = $page->getNameSpace();
     $pageCategories = $page->getCategories();
     $pageInAllowedNameSpaces = $this->isPageInAllowedNameSpaces($pageId, $pageNS);
     $pageInAllowedCategories = $this->isPageInAllowedCategories($pageCategories);
     if ($pageInAllowedNameSpaces || $pageInAllowedCategories) {
         if ($this->isPageExcluded($page)) {
             $attachmentAllowed = false;
         } else {
             $attachmentAllowed = true;
         }
     }
     return $attachmentAllowed;
 }