X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/65b2c905229ebdd1c34614125551dde25d714840..refs/pull/2734/head:/app/helpers.php diff --git a/app/helpers.php b/app/helpers.php index 935d4d8da..c1d72b91d 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -2,7 +2,7 @@ use BookStack\Auth\Permissions\PermissionService; use BookStack\Auth\User; -use BookStack\Ownable; +use BookStack\Model; use BookStack\Settings\SettingService; /** @@ -56,7 +56,7 @@ function hasAppAccess(): bool * Check if the current user has a permission. If an ownable element * is passed in the jointPermissions are checked against that particular item. */ -function userCan(string $permission, Ownable $ownable = null): bool +function userCan(string $permission, Model $ownable = null): bool { if ($ownable === null) { return user() && user()->can($permission); @@ -79,9 +79,9 @@ function userCanOnAny(string $permission, string $entityClass = null): bool /** * Helper to access system settings. - * @return bool|string|SettingService + * @return mixed|SettingService */ -function setting(string $key = null, $default = false) +function setting(string $key = null, $default = null) { $settingService = resolve(SettingService::class);