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
00029
00033 function effect() {
00034 $request =& $this->getRequest();
00035
00036
00037 $monographFile =& $this->getMonographFile($request);
00038 if (!is_a($monographFile, 'MonographFile')) return AUTHORIZATION_DENY;
00039
00040
00041 if ($monographFile->getFileStage() != MONOGRAPH_FILE_SUBMISSION) return AUTHORIZATION_DENY;
00042
00043
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
00049 return AUTHORIZATION_PERMIT;
00050 }
00051 }
00052
00053 ?>