Shelf permissions: Removed unused 'create' permission from view

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.
This commit is contained in:
Dan Brown
2023-06-25 23:22:49 +01:00
parent c74a2608c4
commit 847a57a49a
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,29 @@
<?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.
}
};