Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions classes/security/authorization/internal/DecisionAllowedPolicy.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file classes/security/authorization/internal/DecisionAllowedPolicy.php
*
Expand All @@ -17,6 +18,7 @@
namespace PKP\security\authorization\internal;

use APP\core\Application;
use APP\decision\Decision;
use APP\facades\Repo;
use PKP\db\DAORegistry;
use PKP\security\authorization\AuthorizationPolicy;
Expand Down Expand Up @@ -69,17 +71,23 @@ public function effect()
if (!in_array($userGroup->getRoleId(), [Role::ROLE_ID_MANAGER, Role::ROLE_ID_SUB_EDITOR])) {
continue;
}
if (Repo::decision()->isRecommendation($decisionType->getDecision()) && $stageAssignment->getRecommendOnly()) {
$isAllowed = true;
} elseif (!$stageAssignment->getRecommendOnly()) {

$decision = $decisionType->getDecision();
if (
!$stageAssignment->getRecommendOnly() ||
$decision === Decision::NEW_EXTERNAL_ROUND ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we treat OMP specific internal review the same way? See NEW_INTERNAL_ROUND.

Copy link
Copy Markdown
Contributor Author

@salmanm2003 salmanm2003 Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Vitaliy-1 , The changes have been added for OMP as well.
Here is the PR for OMP: pkp/omp#2312
Could you review it please and let me know if any issues?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vitaliy-1 could you check this please and let me know if any issues?

$decision === Decision::NEW_INTERNAL_ROUND ||
Repo::decision()->isRecommendation($decision)
) {
$isAllowed = true;
break;
}

// Check whether there is a decision that a recommending role can make on the stage the submission is in.
$recommendatorsAvailableDecisions = Repo::decision()
->getDecisionTypesMadeByRecommendingUsers($submission->getData('stageId'));
// if there is any decision that the recommending role is allowed to make, check if the current decision is within the allowed ones

// if there is any decision that the recommending role is allowed to make, check if the current decision is within the allowed ones
if (!empty($recommendatorsAvailableDecisions)) {
$matches = array_filter($recommendatorsAvailableDecisions, function ($decisionInArray) use ($decisionType) {
return $decisionInArray->getDecision() === $decisionType->getDecision();
Expand Down