Skip to content
Snippets Groups Projects
Commit 48ee4a97 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Fixed the permission check when editing a search and the user is not logged in.

parent 716d3174
No related merge requests found
......@@ -392,7 +392,9 @@ class AbstractSearch extends AbstractBase
// Fail if user has no permission to view this search:
$user = $this->getUser();
$sessId = $this->getServiceLocator()->get('VuFind\SessionManager')->getId();
if ($search->session_id != $sessId && $search->user_id != $user->id) {
if ($search->session_id != $sessId
&& ($user === false || $search->user_id != $user->id)
) {
$this->flashMessenger()->addMessage('advSearchError_noRights', 'error');
return false;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment