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:
parent
c74a2608c4
commit
847a57a49a
3 changed files with 39 additions and 1 deletions
database/migrations
|
@ -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.
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue