diff --git a/CHANGELOG.md b/CHANGELOG.md index c2389f2..aacea80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,25 @@ CHANGELOG ===================== +v1.1.2 +--------------------- +* AccessControl filter update default regexp to ^site, in debug mode add gii and debug modules. + +v1.1.1 +--------------------- +* Bugfix: Permission Child/Parents boxes cleanup available options from already exists. +* Bugfix: Permission Child/Parents fixed fatal error on hierarchy loop. + v1.1 --------------------- -* Role permission selector now have better UI with real trees. -* Bugfix: Item name validation not allow '*'. +* NEW: Permissions selector as a real Tree-based selector. +* Bugfix: Fix wrong unique name validations for Role and Permission creating form. * Bugfix: Fatal error on creating Role/Permission with existed name. +v1.0.2 +--------------------- +* Bugfix: Routes Scanner take info from comments as well, not class definition. + v1.0.1 --------------------- * Disable inherit permissions in role permissions selector. diff --git a/src/filters/RouteAccessControl.php b/src/filters/RouteAccessControl.php index 8599ada..1d22153 100755 --- a/src/filters/RouteAccessControl.php +++ b/src/filters/RouteAccessControl.php @@ -12,14 +12,32 @@ class RouteAccessControl extends ActionFilter { /** - * @var array List of action that not need to check access. + * List of action that not need to check access. + * + * @var array */ public $allowActions = []; /** - * @var string Allow route pattern + * Allow route pattern + * in debug mode default value is "/^(site|gii|debug)\//i". + * + * @var string */ - public $allowRegexp = '/(gii)/i'; + public $allowRegexp = '/^(site)\//i'; + + /** + * RouteAccessControl constructor. + * + * @param array $config + */ + public function __construct(array $config = []) + { + if (defined('YII_DEBUG') && YII_DEBUG) { + $this->allowRegexp = '/^(site|gii|debug)\//i'; + } + parent::__construct($config); + } /** * This method is invoked right before an action is to be executed (after all possible filters.) @@ -45,7 +63,7 @@ public function beforeAction($action) } if (in_array($action_rule, $this->allowActions) - || in_array($controller_rule, $this->allowActions) + || in_array($controller_rule, $this->allowActions) ) { $allow = true; } else { @@ -63,7 +81,7 @@ public function beforeAction($action) /** * Deny access method * - * @throws ForbiddenHttpException + * @throws ForbiddenHttpException Deny exception. */ public function denyAccess() {