Skip to content

Commit

Permalink
Merge pull request #276 from djsall/3.x
Browse files Browse the repository at this point in the history
feat: adds support for disabling tenant scoping for the permission re…
  • Loading branch information
bezhanSalleh authored Nov 22, 2023
2 parents 31ad376 + c079437 commit 161010d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/filament-shield.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'navigation_group' => true,
'is_globally_searchable' => false,
'show_model_path' => true,
'is_scoped_to_tenant' => true,
],

'auth_provider_model' => [
Expand Down
5 changes: 5 additions & 0 deletions src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ public static function getNavigationBadge(): ?string
: null;
}

public static function isScopedToTenant(): bool
{
return Utils::isScopedToTenant();
}

public static function canGloballySearch(): bool
{
return Utils::isResourceGloballySearchable() && count(static::getGloballySearchableAttributes()) && static::canViewAny();
Expand Down
5 changes: 5 additions & 0 deletions src/Support/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public static function isResourceNavigationBadgeEnabled(): bool
return config('filament-shield.shield_resource.navigation_badge', true);
}

public static function isScopedToTenant(): bool
{
return config('filament-shield.shield_resource.is_scoped_to_tenant');
}

public static function isResourceNavigationGroupEnabled(): bool
{
return config('filament-shield.shield_resource.navigation_group', true);
Expand Down

0 comments on commit 161010d

Please sign in to comment.