]> BookStack Code Mirror - bookstack/blobdiff - app/helpers.php
Major permission naming refactor and database migration cleanup
[bookstack] / app / helpers.php
index 4fa2f2d4deae39fe3500a14354d47fd4b6e821e7..fea67a09a4c8d047ac52617a1831f5bee0ef33bf 100644 (file)
@@ -31,7 +31,7 @@ if (!function_exists('versioned_asset')) {
 
 /**
  * Check if the current user has a permission.
- * If an ownable element is passed in the permissions are checked against
+ * If an ownable element is passed in the jointPermissions are checked against
  * that particular item.
  * @param $permission
  * @param \BookStack\Ownable $ownable
@@ -44,8 +44,8 @@ function userCan($permission, \BookStack\Ownable $ownable = null)
     }
 
     // Check permission on ownable item
-    $restrictionService = app('BookStack\Services\RestrictionService');
-    return $restrictionService->checkEntityUserAccess($ownable, $permission);
+    $permissionService = app('BookStack\Services\PermissionService');
+    return $permissionService->checkEntityUserAccess($ownable, $permission);
 }
 
 /**