Skip to content

Commit 189a43d

Browse files
[candidate_parameters] Fix candidate_parameters permission problem (#8793)
Remove unnecessary access_profiles permission check that was overriding the module permission checks. Resolves #8733
1 parent 706cd78 commit 189a43d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

modules/candidate_parameters/php/candidate_parameters.class.inc

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,15 @@ class Candidate_Parameters extends \NDB_Form
4242
{
4343
$candidate =& \Candidate::singleton(new CandID($this->identifier));
4444

45-
// User must either have 'access_all_profiles' permission, or
46-
// one of the candidate_parameter permissions AND have the candidate's site.
47-
return $user->hasPermission('access_all_profiles') ||
48-
($user->hasAnyPermission(
49-
[
50-
'candidate_parameter_view',
51-
'candidate_parameter_edit',
52-
]
53-
)
54-
&& $user->hasCenter($candidate->getCenterID())
55-
);
45+
/* User must have one of the candidate_parameter permissions
46+
AND have the candidate's site. */
47+
return ($user->hasAnyPermission(
48+
[
49+
'candidate_parameter_view',
50+
'candidate_parameter_edit',
51+
]
52+
) && $user->hasCenter($candidate->getCenterID())
53+
);
5654
}
5755

5856
/**

0 commit comments

Comments
 (0)