AclManager icon indicating copy to clipboard operation
AclManager copied to clipboard

Getting AclManager to Work with a Users Plugin

Open larry-tx opened this issue 12 years ago • 6 comments

I'm trying to use AclManager with the CakeDC Users plugin. I've tried entering this in the plugin's bootstrap file:

Configure::write('AclManager.aros', array('Group', 'Users.User'));

That gives nothing but errors, most notably including:

Warning (2): Invalid argument supplied for foreach() [APP\Plugin\AclManager\Controller\AclController.php, line 31]

Warning (2): Invalid argument supplied for foreach() [APP\Plugin\AclManager\Controller\AclController.php, line 39]

I also tried it without referencing the plugin as in:

Configure::write('AclManager.aros', array('Group', 'Users.User'));

That gave the same errors.

larry-tx avatar Feb 23 '13 04:02 larry-tx

The error you're showing does not seem linked to using a plugin. Please ensure that your settings are fully loaded first.

FMCorz avatar Feb 23 '13 08:02 FMCorz

See step 5 of the installation instructions.

FMCorz avatar Feb 23 '13 08:02 FMCorz

Thanks so much for that bit of assistance. The entry in my app/config/bootstrap file looks like this:

CakePlugin::load(
        array(
            'Users.Users', array('routes' => TRUE),
            'Utils.Sluggable',
            'ClearCache',
            'AclExtras',
            'AclManager', array('bootstrap' => TRUE),
        )
    );

The entry in the plugin's bootstrap file looks like this:

Configure::write('AclManager.aros', array('Group', 'Users.User'));

Actually, it seems like that last entry is causing the problems. I've also tried it in the following ways:

Configure::write('AclManager.aros', array('Group', 'Users/User'));
Configure::write('AclManager.aros', array('Group', 'User'));

The first one produces the same type of error. The second one just can't find the model.

larry-tx avatar Feb 23 '13 15:02 larry-tx

Sorry for not getting back to you earlier. Have you found a solution to this?

FMCorz avatar Mar 04 '13 01:03 FMCorz

Sorry, I had to move on to some other things, and am only now getting back to this. I have not found any solution. For some reason, this plugin just won't work. I have followed every instruction in the installation directions down to the letter, and I still get this same set of errors relating to "foreach ($aros as $aro)"

larry-tx avatar Apr 10 '13 18:04 larry-tx

Hey!

I got Same error. Any solution please.

Warning (2): Invalid argument supplied for foreach() [APP/Plugin/AclManager/Controller/AclController.php, line 32]

Warning (2): Invalid argument supplied for foreach() [APP/Plugin/AclManager/Controller/AclController.php, line 40]

It is not able to read 'AclManager.models', do we manually set it to plugin's botstrap file?

My Settings: Configure::write('AclManager.aros', array('Group', 'User'));

parthvi avatar Oct 31 '14 11:10 parthvi