opnform/app/Providers/AuthServiceProvider.php

43 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2022-09-20 19:59:52 +00:00
<?php
namespace App\Providers;
use App\Models\Forms\Form;
use App\Models\Integration\FormZapierWebhook;
2022-11-16 12:12:48 +00:00
use App\Models\Template;
2022-09-20 19:59:52 +00:00
use App\Models\Workspace;
use App\Policies\FormPolicy;
use App\Policies\Integration\FormZapierWebhookPolicy;
2022-11-16 12:12:48 +00:00
use App\Policies\TemplatePolicy;
2022-09-20 19:59:52 +00:00
use App\Policies\WorkspacePolicy;
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,
2022-11-16 12:12:48 +00:00
FormZapierWebhook::class => FormZapierWebhookPolicy::class,
Template::class => TemplatePolicy::class,
2022-09-20 19:59:52 +00:00
];
/**
* 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;
});
}
}