Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*5540* Implement new authorization approach that works for AJAX compo…
…nents and page handlers - implemented correct folder structure and nomenclature in OJS
- Loading branch information
Showing
10 changed files
with
67 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
classes/security/authorization/OjsJournalAccessPolicy.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* @file classes/security/authorization/OjsJournalAccessPolicy.inc.php | ||
* | ||
* Copyright (c) 2000-2010 John Willinsky | ||
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. | ||
* | ||
* @class OjsJournalAccessPolicy | ||
* @ingroup security_authorization | ||
* | ||
* @brief Class to control access to OJS' journal setup components | ||
*/ | ||
|
||
import('classes.security.authorization.internal.JournalPolicy'); | ||
|
||
class OjsJournalAccessPolicy extends JournalPolicy { | ||
/** | ||
* Constructor | ||
* @param $request PKPRequest | ||
* @param $roleAssignments array | ||
*/ | ||
function OjsJournalAccessPolicy(&$request, $roleAssignments) { | ||
parent::JournalPolicy($request); | ||
|
||
// On journal level we don't have role-specific conditions | ||
// so we can simply add all role assignments. It's ok if | ||
// any of these role conditions permits access. | ||
$journalRolePolicy = new PolicySet(COMBINING_PERMIT_OVERRIDES); | ||
import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy'); | ||
foreach($roleAssignments as $role => $operations) { | ||
$journalRolePolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, $role, $operations)); | ||
} | ||
$this->addPolicy($journalRolePolicy); | ||
} | ||
} | ||
|
||
?> |
31 changes: 0 additions & 31 deletions
31
classes/security/authorization/OjsJournalSetupPolicy.inc.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...yeditorSubmissionAssignmentPolicy.inc.php → ...yeditorSubmissionAssignmentPolicy.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...ty/authorization/OjsJournalPolicy.inc.php → ...horization/internal/JournalPolicy.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...SectionSubmissionAssignmentPolicy.inc.php → ...SectionSubmissionAssignmentPolicy.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters