0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-11 19:35:37 +00:00

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
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
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.
}
};