FMCorz / AclManager

Plugin to manage Acl for CakePHP 2.x
59 stars 33 forks source link

ActionAuthorizer could not be found #2

Closed timworld closed 12 years ago

timworld commented 12 years ago

Hi,

I've configured the plugin as you show it in README. But I get an "ActionAuthorizer could not be found" when I want to generate my acos. Aros are well generated. If I add manually acos, permissions work well too.

Could you, please, tell me from where it could come?

By the way, thank you for creating this very helpful plugin.

Tim

timworld commented 12 years ago

I figured out the issue. Appartly it was a conflict between $this->Auth->allow and $this->Auth->authorize = array( 'Controller', 'Actions' => array('actionPath' => 'controllers') );

FMCorz commented 12 years ago

Sorry for the long time before my answer. Glad you figured out what the issue was.

rakeshtembhurne commented 10 years ago

I am using CakePHP 2.4.1 and having same issue while trying to use Update ACOs action. Also I am getting An Internal Error Has Occurred error for Update AROs action

In my AppController

public $components = array(
    'Auth' => array(
        'authenticate' => array(
            'Form' => array(
                'passwordHasher' => 'Blowfish',
                'fields' => array('username' => 'email')
            )
        ),
        'loginRedirect' => array(...),
        'logoutRedirect' => array(...),
        'loginAction' => array('controller' => 'users', 'action' => 'login', 'admin' => false, 'plugin' => false),
    ),
    'Acl',
    'Session',
);

In AppController::isAuthorized() action, I tried returning true, false and $this->Auth->loggedIn(). I even tried calling parent::isAuthorize() before returning but it did not work either.

I also tried to see if it works after doing:

I think this is happening with latest version of CakePHP or I might be missing something. Can anybody please confirm that it is happening your setup too?

FMCorz commented 10 years ago

This issue is closed, could you reopen another one for the problem you're experiencing? I suspect 2 issues here. First, the version of PHP you are using, and second, as you said, a problem due to some compatibility with the new version of Cake PHP. I haven't been using Cake for some time now, so please do not hesitate to provide a patch if you find a solution.

Many thanks for the report.

Fred

mzm-dev commented 9 years ago

I am using Cakephp 2.5.4 It's working....

public $components = array(
        'Session', 'Acl',
        'Auth' => array(
            'authorize' => array(
                'Controller',
                'Actions' => array('actionPath' => 'controllers')
            ),
            'loginRedirect' => array(
                'controller' => 'posts',
                'action' => 'index'
            ),
            'logoutRedirect' => array(
                'controller' => 'pages',
                'action' => 'display',
                'home'
            )          
        )
    );

    function isAuthorized($user) {
        // return false;
        return $this->Auth->loggedIn();
    }
kalyanrajiv commented 9 years ago

I am using cakephp 2.5.3 version.

Tim figured out this issue. But I could not understand how he fixed it.

I am using in AppController:

public $components = array( 'Acl', 'Auth' => array( 'authorize' => array( 'Controller', 'Actions' => array('actionPath' => 'controllers') ) ) );

And I am using in many of my controllers:

$this->Auth->allow('func1','func2');

I want to know what to write and where to fix this issue.

Many Thanks,

Kalyan

kalyanrajiv commented 9 years ago

After running cake AclExtras.AclExtras aco_sync from shell, it worked nicely. May be this could be the reason.

Many Thanks,

Kalyan