From 5463ca83bc854fce54622715e302d368bb1f9637 Mon Sep 17 00:00:00 2001 From: Matthew Myers Date: Wed, 5 Jun 2024 11:32:10 -0400 Subject: [PATCH 1/2] Cleanup permission-groups feature flag. --- .../Filament/Resources/PermissionResource.php | 4 +--- .../PermissionsRelationManager.php | 5 +---- app-modules/task/src/Observers/TaskObserver.php | 9 +++------ .../PermissionsRelationManager.php | 5 +---- .../PermissionsRelationManager.php | 5 +---- ...data_purge_permission_groups_feature_flag.php | 16 ++++++++++++++++ 6 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php diff --git a/app-modules/authorization/src/Filament/Resources/PermissionResource.php b/app-modules/authorization/src/Filament/Resources/PermissionResource.php index be56dc785..aef33c4be 100644 --- a/app-modules/authorization/src/Filament/Resources/PermissionResource.php +++ b/app-modules/authorization/src/Filament/Resources/PermissionResource.php @@ -38,7 +38,6 @@ use Filament\Forms\Form; use Filament\Tables\Table; -use Laravel\Pennant\Feature; use Filament\Resources\Resource; use Filament\Tables\Actions\ViewAction; use Filament\Tables\Columns\TextColumn; @@ -79,8 +78,7 @@ public static function table(Table $table): Table ->columns([ IdColumn::make(), TextColumn::make('group.name') - ->sortable() - ->visible(Feature::active('permission-groups')), + ->sortable(), TextColumn::make('name') ->searchable(), TextColumn::make('guard_name') diff --git a/app-modules/authorization/src/Filament/Resources/RoleResource/RelationManagers/PermissionsRelationManager.php b/app-modules/authorization/src/Filament/Resources/RoleResource/RelationManagers/PermissionsRelationManager.php index 1713883a7..a14299f7d 100644 --- a/app-modules/authorization/src/Filament/Resources/RoleResource/RelationManagers/PermissionsRelationManager.php +++ b/app-modules/authorization/src/Filament/Resources/RoleResource/RelationManagers/PermissionsRelationManager.php @@ -37,7 +37,6 @@ namespace AidingApp\Authorization\Filament\Resources\RoleResource\RelationManagers; use Filament\Tables\Table; -use Laravel\Pennant\Feature; use Filament\Facades\Filament; use Filament\Tables\Columns\TextColumn; use AidingApp\Authorization\Models\Role; @@ -78,8 +77,7 @@ public function table(Table $table): Table ->columns([ IdColumn::make(), TextColumn::make('group.name') - ->sortable() - ->visible(Feature::active('permission-groups')), + ->sortable(), TextColumn::make('name'), ]) ->filters( @@ -88,7 +86,6 @@ public function table(Table $table): Table ->relationship('group', 'name') ->searchable() ->preload() - ->visible(Feature::active('permission-groups')) ->multiple(), ] ) diff --git a/app-modules/task/src/Observers/TaskObserver.php b/app-modules/task/src/Observers/TaskObserver.php index 832ca9570..4d95cc62c 100644 --- a/app-modules/task/src/Observers/TaskObserver.php +++ b/app-modules/task/src/Observers/TaskObserver.php @@ -38,7 +38,6 @@ use Exception; use App\Models\User; -use Laravel\Pennant\Feature; use AidingApp\Task\Models\Task; use Illuminate\Support\Facades\DB; use AidingApp\Authorization\Models\Permission; @@ -69,11 +68,9 @@ public function creating(Task $task): void { Permission::create([ 'name' => "task.{$task->id}.update", - ...(Feature::active('permission-groups') ? [ - 'group_id' => PermissionGroup::query() - ->where('name', 'Task') - ->value('id'), - ] : []), + 'group_id' => PermissionGroup::query() + ->where('name', 'Task') + ->value('id'), 'guard_name' => 'web', ]); } diff --git a/app/Filament/Resources/SystemUserResource/RelationManagers/PermissionsRelationManager.php b/app/Filament/Resources/SystemUserResource/RelationManagers/PermissionsRelationManager.php index dc5d0d82a..401dcdb17 100644 --- a/app/Filament/Resources/SystemUserResource/RelationManagers/PermissionsRelationManager.php +++ b/app/Filament/Resources/SystemUserResource/RelationManagers/PermissionsRelationManager.php @@ -39,7 +39,6 @@ use Filament\Forms\Form; use App\Models\SystemUser; use Filament\Tables\Table; -use Laravel\Pennant\Feature; use Filament\Forms\Components\Select; use Filament\Tables\Columns\TextColumn; use Filament\Forms\Components\TextInput; @@ -76,8 +75,7 @@ public function table(Table $table): Table ->columns([ IdColumn::make(), TextColumn::make('group.name') - ->sortable() - ->visible(Feature::active('permission-groups')), + ->sortable(), TextColumn::make('name'), ]) ->filters( @@ -86,7 +84,6 @@ public function table(Table $table): Table ->relationship('group', 'name') ->searchable() ->preload() - ->visible(Feature::active('permission-groups')) ->multiple(), ] ) diff --git a/app/Filament/Resources/UserResource/RelationManagers/PermissionsRelationManager.php b/app/Filament/Resources/UserResource/RelationManagers/PermissionsRelationManager.php index 7b545d3c0..95c45e203 100644 --- a/app/Filament/Resources/UserResource/RelationManagers/PermissionsRelationManager.php +++ b/app/Filament/Resources/UserResource/RelationManagers/PermissionsRelationManager.php @@ -38,7 +38,6 @@ use Filament\Forms\Form; use Filament\Tables\Table; -use Laravel\Pennant\Feature; use Filament\Tables\Columns\TextColumn; use Filament\Forms\Components\TextInput; use App\Filament\Tables\Columns\IdColumn; @@ -70,8 +69,7 @@ public function table(Table $table): Table ->columns([ IdColumn::make(), TextColumn::make('group.name') - ->sortable() - ->visible(Feature::active('permission-groups')), + ->sortable(), TextColumn::make('name'), TextColumn::make('guard_name'), ]) @@ -81,7 +79,6 @@ public function table(Table $table): Table ->relationship('group', 'name') ->searchable() ->preload() - ->visible(Feature::active('permission-groups')) ->multiple(), ] ) diff --git a/database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php b/database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php new file mode 100644 index 000000000..d4d1dd838 --- /dev/null +++ b/database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php @@ -0,0 +1,16 @@ + Date: Wed, 5 Jun 2024 15:35:26 +0000 Subject: [PATCH 2/2] chore: fix enforcement of copyright on all files --- ...a_purge_permission_groups_feature_flag.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php b/database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php index d4d1dd838..5f6f11633 100644 --- a/database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php +++ b/database/migrations/2024_06_05_151320_data_purge_permission_groups_feature_flag.php @@ -1,5 +1,39 @@ + + Copyright © 2016-2024, Canyon GBS LLC. All rights reserved. + + Aiding App™ is licensed under the Elastic License 2.0. For more details, + see + + Notice: + + - You may not provide the software to third parties as a hosted or managed + service, where the service provides users with access to any substantial set of + the features or functionality of the software. + - You may not move, change, disable, or circumvent the license key functionality + in the software, and you may not remove or obscure any functionality in the + software that is protected by the license key. + - You may not alter, remove, or obscure any licensing, copyright, or other notices + of the licensor in the software. Any use of the licensor’s trademarks is subject + to applicable law. + - Canyon GBS LLC respects the intellectual property rights of others and expects the + same in return. Canyon GBS™ and Aiding App™ are registered trademarks of + Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks + vigorously. + - The software solution, including services, infrastructure, and code, is offered as a + Software as a Service (SaaS) by Canyon GBS LLC. + - Use of this software implies agreement to the license terms and conditions as stated + in the Elastic License 2.0. + + For more information or inquiries please visit our website at + or contact us via email at legal@canyongbs.com. + + +*/ + use Laravel\Pennant\Feature; use Illuminate\Database\Migrations\Migration;