Closed timworld closed 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') );
Sorry for the long time before my answer. Glad you figured out what the issue was.
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:
Console/cake AclExtras.AclExtras aco_update
Console/cake AclExtras.AclExtras aco_sync
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?
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
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();
}
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
After running cake AclExtras.AclExtras aco_sync from shell, it worked nicely. May be this could be the reason.
Many Thanks,
Kalyan
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