Skip to content

Commit

Permalink
model activity widget permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
fzldn committed Sep 20, 2024
1 parent ee36ac6 commit cf1fb7c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@
use Filament\Widgets\TableWidget as BaseWidget;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Support\Facades\Gate;

class ModelActivity extends BaseWidget
{
public ?Model $causer = null;
public ?Model $subject = null;

public static function canView(): bool
{
return Gate::check('viewAny', Activity::class);
}

public function getHeading(): ?string
{
if ($this->causer) {
Expand Down

0 comments on commit cf1fb7c

Please sign in to comment.