Im following the RBAC Guide, and there seems to be something missing. Namely, when I run the "yii rbac/init" command, I get the following error:
PHP Warning 'yii\base\ErrorException' with message 'Invalid argument supplied for foreach()'
in /var/www/site/vendor/yiisoft/yii2/rbac/PhpManager.php:641
Stack trace:
#0 /var/www/site/vendor/yiisoft/yii2/rbac/PhpManager.php(641): yii\base\ErrorHandler->handleError(2, 'Invalid argumen...', '/var/www/site/v...', 641, Array)
This looks like it happens when PhpManager tries to load $items. My backend/rbac/items.php file is blank, since I havent run this migration yet.
Has anyone else run into this error? Ive pretty much followed the guide exactly as it is written. What am I missing? What needs to go in items.php for PhpManager to work? What information is missing from the guide?
------- update -----------
after reading all the source code for everything rbac (w/ PhpManager), i realized there are some steps to the guide that are a bit misleading. i had already created a blank items.php, assignments.php, and roles.php before i created the console command (RbacController). once i deleted these files, the console command i made worked as expected.