check()) return false; if ($ownable === null) { return auth()->user() && auth()->user()->can($permission); } // Check permission on ownable item $restrictionService = app('BookStack\Services\RestrictionService'); return $restrictionService->checkEntityUserAccess($ownable, $permission); } /** * Helper to access system settings. * @param $key * @param bool $default * @return mixed */ function setting($key, $default = false) { $settingService = app('BookStack\Services\SettingService'); return $settingService->get($key, $default); }