X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/2a4ff6fb6af18fb0b7ae98ddb6434a19899c73d1..refs/pull/110/head:/app/helpers.php diff --git a/app/helpers.php b/app/helpers.php index f25a8f765..fea67a09a 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -1,10 +1,10 @@ user() && auth()->user()->can($permission); + } + + // Check permission on ownable item + $permissionService = app('BookStack\Services\PermissionService'); + return $permissionService->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); +}