]> BookStack Code Mirror - bookstack/blobdiff - app/Permissions/ContentPermissionApiController.php
ZIP Imports: Added API examples, finished testing
[bookstack] / app / Permissions / ContentPermissionApiController.php
index f883a292bb7ed4bd07cd1ad8b35dd1152940b216..bddbc2c7d95ee6b80c530410c137544ee5453552 100644 (file)
@@ -5,7 +5,7 @@ namespace BookStack\Permissions;
 use BookStack\Entities\EntityProvider;
 use BookStack\Entities\Models\Entity;
 use BookStack\Entities\Tools\PermissionsUpdater;
-use BookStack\Http\Controllers\ApiController;
+use BookStack\Http\ApiController;
 use Illuminate\Http\Request;
 
 class ContentPermissionApiController extends ApiController
@@ -16,7 +16,7 @@ class ContentPermissionApiController extends ApiController
     ) {
     }
 
-    protected $rules = [
+    protected array $rules = [
         'update' => [
             'owner_id'  => ['int'],
 
@@ -38,8 +38,10 @@ class ContentPermissionApiController extends ApiController
 
     /**
      * Read the configured content-level permissions for the item of the given type and ID.
+     *
      * 'contentType' should be one of: page, book, chapter, bookshelf.
      * 'contentId' should be the relevant ID of that item type you'd like to handle permissions for.
+     *
      * The permissions shown are those that override the default for just the specified item, they do not show the
      * full evaluated permission for a role, nor do they reflect permissions inherited from other items in the hierarchy.
      * Fallback permission values may be `null` when inheriting is active.
@@ -57,6 +59,7 @@ class ContentPermissionApiController extends ApiController
     /**
      * Update the configured content-level permission overrides for the item of the given type and ID.
      * 'contentType' should be one of: page, book, chapter, bookshelf.
+     *
      * 'contentId' should be the relevant ID of that item type you'd like to handle permissions for.
      * Providing an empty `role_permissions` array will remove any existing configured role permissions,
      * so you may want to fetch existing permissions beforehand if just adding/removing a single item.