mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
23 lines
551 B
PHP
23 lines
551 B
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
use App\Models\Environment;
|
|
use Illuminate\Auth\Access\AuthorizationException;
|
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
|
|
|
trait AuthorizesResourceCreation
|
|
{
|
|
use AuthorizesRequests;
|
|
|
|
/**
|
|
* Authorize creation of all supported resources, in the environment when one is given.
|
|
*
|
|
* @throws AuthorizationException
|
|
*/
|
|
protected function authorizeResourceCreation(?Environment $environment = null): void
|
|
{
|
|
$this->authorize('createAnyResource', [$environment]);
|
|
}
|
|
}
|