Skip to content

Commit

Permalink
Avoid deprecated notice in modAccessibleObject::checkPolicy (#16443)
Browse files Browse the repository at this point in the history
  • Loading branch information
opengeek authored Aug 29, 2023
1 parent 56bdb13 commit c4d7ac8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/Revolution/modAccessibleObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ public function remove(array $ancestors = [])
*/
public function checkPolicy($criteria, $targets = null, modUser $user = null)
{
if (!$user) {
$user = &$this->xpdo->user;
}
if ($criteria && $this->xpdo instanceof modX && $this->xpdo->getSessionState() == modX::SESSION_STATE_INITIALIZED) {
if (!$user) {
$user = $this->xpdo->user;
}
if ($user->get('sudo')) {
return true;
}
Expand Down

0 comments on commit c4d7ac8

Please sign in to comment.