hscstudio / yii2-mimin

Simple RBAC Manager for Yii2 (minify of yii2-admin)
51 stars 33 forks source link

Wrong behavior Mimin::checkRoute #18

Closed chiliman-oOo closed 7 years ago

chiliman-oOo commented 7 years ago

Mimin::checkRoute('<controller/action>') return true if you've allowed any action for this controller or controller whose name starts with the same. Fro example: You have routes: /client/ /client/create /client/view /client-source/

You allow access to /client/create and to/client-source/*, but if you check Mimin::checkRoute('/client/view') it returned true (.

I think it hppen there https://github.com/hscstudio/yii2-mimin/blob/master/components/Mimin.php#L37 Because AuthItem::find()->where('name LIKE :param')->addParams([':param' => $parent.'%'])->all() get all where exist "/client%" -> "/client/create" and "/client-source/*"...

hscstudio commented 7 years ago

oke I have merge Your commit thx