mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 15:10:54 +00:00
1. 添加RBAC的权限&角色控制件; 2. 将用户‘is_admin’转换为角色; 3. 针对RBAC对管理页面进行定制化处理; 4. 加深layout分层处理; 5. 修改部分路由名称; 6. 分解路由文件至多文件;
33 lines
656 B
PHP
33 lines
656 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Gate;
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* The policy mappings for the application.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $policies = [
|
|
// 'App\Model' => 'App\Policies\ModelPolicy',
|
|
];
|
|
|
|
/**
|
|
* Register any authentication / authorization services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
$this->registerPolicies();
|
|
|
|
Gate::before(function ($user) {
|
|
return $user->hasRole('Super Admin') ? true : null;
|
|
});
|
|
}
|
|
}
|