Skip to content

Commit

Permalink
*8363* Removed ROLE_ID_EDITOR
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Mar 25, 2015
1 parent f2f2c66 commit 1c01385
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion classes/controllers/grid/issues/IssueGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IssueGridHandler extends GridHandler {
function IssueGridHandler() {
parent::GridHandler();
$this->addRoleAssignment(
array(ROLE_ID_EDITOR, ROLE_ID_MANAGER),
array(ROLE_ID_MANAGER),
array(
'fetchGrid', 'fetchRow',
'addIssue', 'editIssue', 'editIssueData', 'updateIssue',
Expand Down
6 changes: 3 additions & 3 deletions classes/install/Upgrade.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ function migrateUserRoles() {
while ($group = $userGroups->next()) {
if ($group->getData('nameLocaleKey') == 'default.groups.name.editor') {
$editorUserGroup = $group; // stash for later.
$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), ROLE_ID_EDITOR));
$userResult = $journalDao->retrieve('SELECT user_id FROM roles WHERE journal_id = ? AND role_id = ?', array((int) $journal->getId(), 0x00000100 /* ROLE_ID_EDITOR */));
while (!$userResult->EOF) {
$row = $userResult->GetRowAssoc(false);
$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());
Expand Down Expand Up @@ -676,7 +676,7 @@ function migrateUserRoles() {
// Journal Editors
// First, full editors.
$editorsResult = $stageAssignmentDao->retrieve('SELECT e.* FROM submissions s, edit_assignments e, users u, roles r WHERE r.user_id = e.editor_id AND r.role_id = ' .
ROLE_ID_EDITOR . ' AND e.article_id = ? AND r.journal_id = s.context_id AND s.submission_id = e.article_id AND e.editor_id = u.user_id', array($submissionId));
0x00000100 /* ROLE_ID_EDITOR */ . ' AND e.article_id = ? AND r.journal_id = s.context_id AND s.submission_id = e.article_id AND e.editor_id = u.user_id', array($submissionId));
while (!$editorsResult->EOF) {
$editorRow = $editorsResult->GetRowAssoc(false);
$stageAssignmentDao->build($submissionId, $editorUserGroup->getId(), $editorRow['editor_id']);
Expand All @@ -686,7 +686,7 @@ function migrateUserRoles() {

// Section Editors.
$editorsResult = $stageAssignmentDao->retrieve('SELECT e.* FROM submissions s LEFT JOIN edit_assignments e ON (s.submission_id = e.article_id) LEFT JOIN users u ON (e.editor_id = u.user_id)
LEFT JOIN roles r ON (r.user_id = e.editor_id AND r.role_id = ' . ROLE_ID_EDITOR . ' AND r.journal_id = s.context_id) WHERE e.article_id = ? AND s.submission_id = e.article_id
LEFT JOIN roles r ON (r.user_id = e.editor_id AND r.role_id = ' . 0x00000100 /* ROLE_ID_EDITOR */ . ' AND r.journal_id = s.context_id) WHERE e.article_id = ? AND s.submission_id = e.article_id
AND r.role_id IS NULL', array($submissionId));
while (!$editorsResult->EOF) {
$editorRow = $editorsResult->GetRowAssoc(false);
Expand Down
1 change: 0 additions & 1 deletion classes/issue/IssueAction.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ function _roleAllowedPrePublicationAccess($journal) {
$userId = $user->getId();
$subscriptionAssumedRoles = array(
ROLE_ID_MANAGER,
ROLE_ID_EDITOR,
ROLE_ID_SECTION_EDITOR,
ROLE_ID_ASSISTANT,
ROLE_ID_SUBSCRIPTION_MANAGER
Expand Down
2 changes: 0 additions & 2 deletions classes/security/RoleDAO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import('lib.pkp.classes.security.PKPRoleDAO');

/** ID codes for all user roles */
define('ROLE_ID_EDITOR', 0x00000100);
define('ROLE_ID_SECTION_EDITOR', 0x00000011);
define('ROLE_ID_SUBSCRIPTION_MANAGER', 0x00200000);
define('ROLE_ID_GUEST_EDITOR', 0x00000201);
Expand All @@ -45,7 +44,6 @@ static function getRoleNames($contextOnly = false, $roleIds = null) {

$journalRoleNames = array(
ROLE_ID_MANAGER => 'user.role.manager',
ROLE_ID_EDITOR => 'user.role.editor',
ROLE_ID_GUEST_EDITOR => 'user.role.guestEditor',
ROLE_ID_ASSISTANT => 'user.role.journalAssistant',
ROLE_ID_SECTION_EDITOR => 'user.role.sectionEditor',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function dataObjectEffect() {
array(
ROLE_ID_SITE_ADMIN,
ROLE_ID_MANAGER,
ROLE_ID_EDITOR,
ROLE_ID_SECTION_EDITOR,
ROLE_ID_ASSISTANT,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function effect() {
$userRoles,
array(
ROLE_ID_MANAGER,
ROLE_ID_EDITOR,
ROLE_ID_SITE_ADMIN,
ROLE_ID_ASSISTANT,
ROLE_ID_SECTION_EDITOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ArticleGalleyGridHandler extends GridHandler {
function ArticleGalleyGridHandler() {
parent::GridHandler();
$this->addRoleAssignment(
array(ROLE_ID_EDITOR, ROLE_ID_MANAGER),
array(ROLE_ID_MANAGER),
array(
'fetchGrid', 'fetchRow', 'saveSequence',
'add', 'edit', 'update', 'delete',
Expand Down
2 changes: 1 addition & 1 deletion controllers/grid/citation/CitationGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CitationGridHandler extends PKPCitationGridHandler {
function CitationGridHandler() {
parent::PKPCitationGridHandler();
$this->addRoleAssignment(
array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR),
array(ROLE_ID_MANAGER, ROLE_ID_SECTION_EDITOR),
array('fetchGrid', 'addCitation', 'editCitation', 'updateRawCitation',
'checkCitation', 'updateCitation', 'deleteCitation', 'exportCitations',
'fetchCitationFormErrorsAndComparison', 'sendAuthorQuery'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class IssueGalleyGridHandler extends GridHandler {
function IssueGalleyGridHandler() {
parent::GridHandler();
$this->addRoleAssignment(
array(ROLE_ID_EDITOR, ROLE_ID_MANAGER),
array(ROLE_ID_MANAGER),
array(
'fetchGrid', 'fetchRow', 'saveSequence',
'add', 'edit', 'upload', 'download', 'update', 'delete'
Expand Down
2 changes: 1 addition & 1 deletion controllers/grid/toc/TocGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TocGridHandler extends CategoryGridHandler {
function TocGridHandler() {
parent::CategoryGridHandler();
$this->addRoleAssignment(
array(ROLE_ID_EDITOR, ROLE_ID_MANAGER),
array(ROLE_ID_MANAGER),
array('fetchGrid', 'fetchCategory', 'fetchRow', 'saveSequence', 'removeArticle')
);
$this->publishedArticlesBySectionId = array();
Expand Down
6 changes: 3 additions & 3 deletions controllers/grid/users/author/AuthorGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class AuthorGridHandler extends PKPAuthorGridHandler {
function AuthorGridHandler() {
parent::PKPAuthorGridHandler();
$this->addRoleAssignment(
array(ROLE_ID_MANAGER, ROLE_ID_EDITOR, ROLE_ID_AUTHOR, ROLE_ID_SECTION_EDITOR),
array(ROLE_ID_MANAGER, ROLE_ID_AUTHOR, ROLE_ID_SECTION_EDITOR),
array('fetchGrid', 'fetchRow', 'addAuthor', 'editAuthor',
'updateAuthor', 'deleteAuthor'));
$this->addRoleAssignment(ROLE_ID_REVIEWER, array('fetchGrid', 'fetchRow'));
$this->addRoleAssignment(array(ROLE_ID_MANAGER, ROLE_ID_EDITOR), array('addUser'));
$this->addRoleAssignment(array(ROLE_ID_MANAGER), array('addUser'));
}


Expand Down Expand Up @@ -80,7 +80,7 @@ function canAdminister() {
$userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES);
// N.B.: $article will not be defined yet for feature
// initialization, which happens prior to fetching.
if (!$article || $article->getDateSubmitted() == null || array_intersect(array(ROLE_ID_MANAGER, ROLE_ID_EDITOR), $userRoles))
if (!$article || $article->getDateSubmitted() == null || array_intersect(array(ROLE_ID_MANAGER), $userRoles))
return true;
else
return false;
Expand Down
2 changes: 1 addition & 1 deletion controllers/grid/users/author/AuthorGridRow.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function canAdminister($request) {
$stageAssignments = $stageAssignmentDao->getBySubmissionAndStageId($submission->getId(), $submission->getStageId(), null, $user->getId());
while ($stageAssignment = $stageAssignments->next()) {
$userGroup = $userGroupDao->getById($stageAssignment->getUserGroupId());
if (in_array($userGroup->getRoleId(), array(ROLE_ID_MANAGER, ROLE_ID_EDITOR))) {
if (in_array($userGroup->getRoleId(), array(ROLE_ID_MANAGER))) {
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function getEditorialInfo($journalId) {

$response = '';
$roleDao = DAORegistry::getDAO('RoleDAO');
$roleMap = array(ROLE_ID_EDITOR => 'editor', ROLE_ID_SECTION_EDITOR => 'secteditor', ROLE_ID_MANAGER => 'jmanager');
$roleMap = array(ROLE_ID_SECTION_EDITOR => 'secteditor', ROLE_ID_MANAGER => 'editor');
foreach ($roleMap as $roleId => $roleName) {
$users = $roleDao->getUsersByRoleId($roleId, $journalId);
$isFirst = true;
Expand Down
2 changes: 1 addition & 1 deletion templates/header/localnav.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="pkp_structure_head_localNav">
{if $isUserLoggedIn}
<ul class="sf-menu">
{if array_intersect(array(ROLE_ID_MANAGER, ROLE_ID_EDITOR, ROLE_ID_ASSISTANT, ROLE_ID_REVIEWER, ROLE_ID_AUTHOR), $userRoles)}
{if array_intersect(array(ROLE_ID_MANAGER, ROLE_ID_ASSISTANT, ROLE_ID_REVIEWER, ROLE_ID_AUTHOR), $userRoles)}
<li><a href="{url router=$smarty.const.ROUTE_PAGE page="dashboard"}">{translate key="navigation.dashboard"}</a></li>
{/if}
{if $currentJournal}
Expand Down

0 comments on commit 1c01385

Please sign in to comment.