承接 beranidigital/filament-access 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

beranidigital/filament-access

最新稳定版本:0.2.1

Composer 安装命令:

composer require beranidigital/filament-access

包简介

Multi-panel aware fine-grained permissions for Laravel Filament to analyze, generate and inject into all classes and methods in the application. or whatever that means.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Multi-panel aware ultra-fine-grained permissions for Laravel Filament to analyze, generate and inject into all classes and methods in the application.

What this package does

  • Generate list of almost all Filament component permissions
  • Automatically redefine classes to avoid conflict

Why I need this package

  • You have too many classes and methods to define permissions one by one
  • Default Filament authorization doesn't support multi-panel

What this package doesn't do

  • It doesn't provide complete solution for authorization
  • It's not meant for custom defined permissions, you need to define it yourself

Installation

You can install the package via composer:

composer require beranidigital/filament-access

You can publish the config file with:

php artisan vendor:publish --tag="filament-access-config"

Usage

\BeraniDigitalID\FilamentAccess\Facades\FilamentAccess::analyzeAll();

or

php artisan filament-access:generate
php artisan filament-access:hijack

How it works

  1. It hooks into a class to correct the permission
  2. The class will call Gate::authorize('viewAny', $correctArgument) with an example of App\Filament\Resources\MyResource as the argument
  3. It's up to you to authorize it with your own custom logic
\Illuminate\Support\Facades\Gate::before(function ($user, $ability, $arguments) {
    $permission = \BeraniDigitalID\FilamentAccess\Facades\FilamentAccess::determinePermissionName($ability, $arguments);
    if (!$user->hasPermissionTo($permission)) {
        return false;
    }
    // continue to the next authorization logic
});

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 557
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-05