_context = $request->getContext(); } // // Implement template methods from AuthorizationPolicy // function effect() { if (!$this->_context) return AUTHORIZATION_DENY; // Certain roles are allowed to see unpublished content. $userRoles = (array) $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES); if (count(array_intersect( $userRoles, array( ROLE_ID_MANAGER, ROLE_ID_SITE_ADMIN, ROLE_ID_ASSISTANT, ROLE_ID_SUB_EDITOR ) ))>0) { return AUTHORIZATION_PERMIT; } if ($this->_context->getSetting('publishingMode') == PUBLISHING_MODE_NONE) { return AUTHORIZATION_DENY; } return AUTHORIZATION_PERMIT; } } ?>