mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-06-15 13:32:43 +01:00
25 lines
579 B
PHP
25 lines
579 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers\Web;
|
|
|
|
use App\Models\Organization;
|
|
use App\Service\PermissionStore;
|
|
use Illuminate\Auth\Access\AuthorizationException;
|
|
|
|
abstract class Controller extends \App\Http\Controllers\Controller
|
|
{
|
|
public function __construct(
|
|
protected PermissionStore $permissionStore,
|
|
) {}
|
|
|
|
/**
|
|
* @throws AuthorizationException
|
|
*/
|
|
protected function hasPermission(Organization $organization, string $permission): bool
|
|
{
|
|
return $this->permissionStore->has($organization, $permission);
|
|
}
|
|
}
|