First Commit

This commit is contained in:
marco
2026-09-01 07:49:48 -03:00
commit 28b1044038
399 changed files with 41659 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
use App\Models\Subject;
use App\Models\UserInterest;
use App\Policies\SubjectPolicy;
use App\Policies\UserInterestPolicy;
/**
* Application authentication and authorization service provider.
*/
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*/
protected $policies = [
Subject::class => SubjectPolicy::class,
UserInterest::class => UserInterestPolicy::class,
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
$this->registerPolicies();
Gate::before(function ($user, $ability) {
if ($user->hasRole('superadmin')) {
return true;
}
});
}
}