Skip to content

Commit

Permalink
Merge pull request #111 from canyongbs/cleanup/aidapp-87-permission-g…
Browse files Browse the repository at this point in the history
…roups-feature

[AIDAPP-87]: [Cleanup] permission-groups feature
  • Loading branch information
Orrison authored Jun 5, 2024
2 parents f383c99 + 5d7bf10 commit fea1baf
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand All @@ -88,7 +86,6 @@ public function table(Table $table): Table
->relationship('group', 'name')
->searchable()
->preload()
->visible(Feature::active('permission-groups'))
->multiple(),
]
)
Expand Down
9 changes: 3 additions & 6 deletions app-modules/task/src/Observers/TaskObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand All @@ -86,7 +84,6 @@ public function table(Table $table): Table
->relationship('group', 'name')
->searchable()
->preload()
->visible(Feature::active('permission-groups'))
->multiple(),
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'),
])
Expand All @@ -81,7 +79,6 @@ public function table(Table $table): Table
->relationship('group', 'name')
->searchable()
->preload()
->visible(Feature::active('permission-groups'))
->multiple(),
]
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

/*
<COPYRIGHT>
Copyright © 2016-2024, Canyon GBS LLC. All rights reserved.
Aiding App™ is licensed under the Elastic License 2.0. For more details,
see <https://github.com/canyongbs/aidingapp/blob/main/LICENSE.>
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
<https://www.canyongbs.com> or contact us via email at legal@canyongbs.com.
</COPYRIGHT>
*/

use Laravel\Pennant\Feature;
use Illuminate\Database\Migrations\Migration;

return new class () extends Migration {
public function up(): void
{
Feature::purge('permission-groups');
}

public function down(): void
{
Feature::activate('permission-groups');
}
};

0 comments on commit fea1baf

Please sign in to comment.