Initial commit
This commit is contained in:
41
app/Providers/AuthServiceProvider.php
Normal file
41
app/Providers/AuthServiceProvider.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Forms\Form;
|
||||
use App\Models\Integration\FormZapierWebhook;
|
||||
use App\Models\Workspace;
|
||||
use App\Models\User;
|
||||
use App\Policies\FormPolicy;
|
||||
use App\Policies\Integration\FormZapierWebhookPolicy;
|
||||
use App\Policies\WorkspacePolicy;
|
||||
use App\Policies\UserPolicy;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
Form::class => FormPolicy::class,
|
||||
Workspace::class => WorkspacePolicy::class,
|
||||
FormZapierWebhook::class => FormZapierWebhookPolicy::class
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
|
||||
\Illuminate\Support\Facades\Gate::define('viewMailcoach', function ($user = null) {
|
||||
return optional($user)->admin;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user