• Main Page
  • Modules
  • Classes
  • Files
  • File List

classes/security/authorization/internal/MonographFileSubmissionStageRequiredPolicy.inc.php

00001 <?php
00015 import('classes.security.authorization.internal.MonographFileBaseAccessPolicy');
00016 
00017 class MonographFileSubmissionStageRequiredPolicy extends MonographFileBaseAccessPolicy {
00022    function MonographFileSubmissionStageRequiredPolicy(&$request, $fileIdAndRevision = null) {
00023       parent::MonographFileBaseAccessPolicy($request, $fileIdAndRevision);
00024    }
00025 
00026 
00027    //
00028    // Implement template methods from AuthorizationPolicy
00029    //
00033    function effect() {
00034       $request =& $this->getRequest();
00035 
00036       // Get the monograph file.
00037       $monographFile =& $this->getMonographFile($request);
00038       if (!is_a($monographFile, 'MonographFile')) return AUTHORIZATION_DENY;
00039 
00040       // Make sure that it's in the submission stage
00041       if ($monographFile->getFileStage() != MONOGRAPH_FILE_SUBMISSION) return AUTHORIZATION_DENY;
00042 
00043       // Make sure the file belongs to the monograph in request.
00044       $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
00045       if (!is_a($monograph, 'Monograph')) return AUTHORIZATION_DENY;
00046       if ($monograph->getId() != $monographFile->getSubmissionId()) return AUTHORIZATION_DENY;
00047 
00048       // Made it through -- permit access.
00049       return AUTHORIZATION_PERMIT;
00050    }
00051 }
00052 
00053 ?>

Generated on Mon Sep 17 2012 13:58:55 for Open Monograph Press by  doxygen 1.7.1