0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-04-30 06:30:03 +00:00

Continued with database work for permissions overhaul

Added to the entity_permissions table with further required fields and indexes.
Wrote the code for checking permissions.
This commit is contained in:
Dan Brown 2016-04-23 18:14:26 +01:00
parent ea287ebf86
commit ada7c83e96
6 changed files with 186 additions and 182 deletions

View file

@ -19,7 +19,16 @@ class CreateEntityPermissionsTable extends Migration
$table->integer('entity_id');
$table->string('action');
$table->boolean('has_permission')->default(false);
$table->boolean('has_permission_own')->default(false);
$table->integer('created_by');
$table->index(['entity_id', 'entity_type']);
$table->index('role_id');
$table->index('action');
$table->index('created_by');
});
$restrictionService = app(\BookStack\Services\RestrictionService::class);
$restrictionService->buildEntityPermissions();
}
/**