/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Foundation/Auth/Access/Authorizable.php
56 строк
1 KB
webard
change BackedEnum to UnitEnum in Authorizable trait (#58258)
03 янв 2026, 21:04
Не верифицирован
03 янв 2026, 21:04
7b774ce
Код
Авторство
О чём код?
<?php namespace Illuminate\Foundation\Auth\Access; use Illuminate\Contracts\Auth\Access\Gate; trait Authorizable { /** * Determine if the entity has the given abilities. * * @param iterable|\UnitEnum|string $abilities * @param mixed $arguments * @return bool */ public function can($abilities, $arguments = []) { return app(Gate::class)->forUser($this)->check($abilities, $arguments); } /** * Determine if the entity has any of the given abilities. * * @param iterable|\UnitEnum|string $abilities * @param mixed $arguments * @return bool */ public function canAny($abilities, $arguments = []) { return app(Gate::class)->forUser($this)->any($abilities, $arguments); } /** * Determine if the entity does not have the given abilities. * * @param iterable|\UnitEnum|string $abilities * @param mixed $arguments * @return bool */ public function cant($abilities, $arguments = []) { return ! $this->can($abilities, $arguments); } /** * Determine if the entity does not have the given abilities. * * @param iterable|\UnitEnum|string $abilities * @param mixed $arguments * @return bool */ public function cannot($abilities, $arguments = []) { return $this->cant($abilities, $arguments); } }