芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/mctv/lib/Entity/ApplicationScope.php
. */ namespace Xibo\Entity; use Xibo\Service\LogServiceInterface; use Xibo\Storage\StorageServiceInterface; use Xibo\Support\Exception\AccessDeniedException; /** * Class ApplicationScope * @package Xibo\Entity */ class ApplicationScope implements \JsonSerializable { use EntityTrait; /** * @var string */ public $id; /** * @var string */ public $description; /** * Entity constructor. * @param StorageServiceInterface $store * @param LogServiceInterface $log */ public function __construct($store, $log) { $this->setCommonDependencies($store, $log); } /** * Get Id * @return string */ public function getId() { return $this->id; } /** * Check whether this scope has permission for this route * @param $method * @param $route * @throws AccessDeniedException */ public function checkRoute($method, $route) { $route = $this->getStore()->select(' SELECT * FROM `oauth_scope_routes` WHERE scopeId = :scope AND method = :method AND route = :route ', [ 'scope' => $this->getId(), 'method' => $method, 'route' => $route ]); if (count($route) <= 0) throw new AccessDeniedException(__('Access to this route is denied for this scope')); } }