Was causing confusion.
Added test to cover.
Also added migration to remove existing create entries to pre-emptively
avoid issues in future if 'create' is used again.
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Support\Facades\DB;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ DB::table('entity_permissions')
+ ->where('entity_type', '=', 'bookshelf')
+ ->update(['create' => 0]);
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ // No structural changes to make, and we cannot know the permissions to re-assign.
+ }
+};
'disabled' => $inheriting
])
</div>
- @if($entityType !== 'page')
+ @if($entityType !== 'page' && $entityType !== 'bookshelf')
<div class="px-l">
@include('form.custom-checkbox', [
'name' => 'permissions[' . $role->id . '][create]',
$this->entityRestrictionFormTest(Page::class, 'Page Permissions', 'delete', '2');
}
+ public function test_shelf_create_permission_not_visible()
+ {
+ $shelf = $this->entities->shelf();
+
+ $resp = $this->asAdmin()->get($shelf->getUrl('/permissions'));
+ $html = $this->withHtml($resp);
+ $html->assertElementNotExists('input[name$="[create]"]');
+ }
+
public function test_restricted_pages_not_visible_in_book_navigation_on_pages()
{
$chapter = $this->entities->chapter();