nenad-zivkovic / yii2-advanced-template

Yii2 improved advanced application template that can bake you cookies
BSD 3-Clause "New" or "Revised" License
93 stars 66 forks source link

Rbac init error #17

Closed timohus closed 9 years ago

timohus commented 9 years ago

When doing "yii rbac/init" an error appears: PHP Compile Error 'yii\base\ErrorException' with message 'Declaration of common\rbac\rules\AuthorRule::execute() must be compatible with yii\rbac\Rule::execute($item, $params)' Had to edit _protected\vendor\yiisoft\yii2\rbac\Rule.php. I've changed this "abstract public function execute($item, $params);" to this "abstract public function execute($user, $item, $params);"

nenad-zivkovic commented 9 years ago

There was some silly mistake in my migration, I've fixed it in 2.2.1. But other than that rbac/init should work without hacking framework. Have you installed rbac tables by running migration ./yii migrate ? You have done all the steps of the installation process described in the guide ?

timohus commented 9 years ago

Sorry, my bad. I missed one important step. I've done a fresh installation of composer before and I've missed to do this: < composer global require "fxp/composer-asset-plugin:~1.0.0" > Now I've done it all from the beginning (after installing composer asset plugin) and everything works great. Thank you!

nenad-zivkovic commented 9 years ago

No problem