method __construct documentation in bbn\User\Permissions

Permissions constructor.

function(array $routes = NULL) { if (!($this->opt = Option::getInstance())) { throw new Exception(X::_('Impossible to construct permissions: you need to instantiate options before')); } if (!($this->user = User::getInstance())) { throw new Exception(X::_('Impossible to construct permissions: you need to instantiate user before')); } if (!($this->pref = Preferences::getInstance())) { throw new Exception(X::_('Impossible to construct permissions: you need to instantiate preferences before')); } /** @todo Add the default routes from Mvc::getInstance */ if (empty($routes)) { $mvc = Mvc::getInstance(); $routes = $mvc->getRoutes(); } if ($routes) { if (!empty($routes['root'])) { foreach ($routes['root'] as $url => $plugin) { $plugin['url'] = $url; $this->plugins[] = $plugin; } } if (!empty($routes['allowed']) && is_array($routes['allowed'])) { $this->allowedRoutes = $routes['allowed']; } if (!empty($routes['forbidden']) && is_array($routes['forbidden'])) { $this->forbiddenRoutes = $routes['forbidden']; } } self::retrieverInit($this); self::optionalInit(); $this->db = Db::getInstance(); }

Permissions constructor. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.