mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-10 21:53:34 +08:00
Implemented functionality to make books sort function
Also changed public user settings to be stored in session rather than DB. Cleaned existing list view type logic.
This commit is contained in:
@ -123,6 +123,20 @@ abstract class Controller extends BaseController
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current user has a permission or bypass if the provided user
|
||||
* id matches the current user.
|
||||
* @param string $permissionName
|
||||
* @param int $userId
|
||||
* @return bool
|
||||
*/
|
||||
protected function checkPermissionOrCurrentUser(string $permissionName, int $userId)
|
||||
{
|
||||
return $this->checkPermissionOr($permissionName, function() use ($userId) {
|
||||
return $userId === $this->currentUser->id;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send back a json error message.
|
||||
* @param string $messageText
|
||||
|
Reference in New Issue
Block a user