diff options
Diffstat (limited to 'includes/classes/LibertyProtector.php')
| -rwxr-xr-x | includes/classes/LibertyProtector.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/classes/LibertyProtector.php b/includes/classes/LibertyProtector.php index eb37666..6b10dcb 100755 --- a/includes/classes/LibertyProtector.php +++ b/includes/classes/LibertyProtector.php @@ -181,6 +181,12 @@ function protector_content_display( &$pContent, &$pParamHash ) { function protector_content_verify_access( $pContent, $pHash ) { global $gBitUser, $gBitSystem; + // Called via invokeServices with no argument; derive roles from current user + if( $pHash === null ) { + $userId = $gBitUser->mUserId ?? -1; + $pHash = \array_keys( $gBitUser->getRoles( $userId, true ) ) ?: [-1]; + } + $error = null; if ( $pContent && $pContent->isValid() ) { if( !$pContent->verifyId( $pContent->mContentId ) ) { |
