fmcorz / aclmanager Goto Github PK
View Code? Open in Web Editor NEWPlugin to manage Acl for CakePHP 2.x
Plugin to manage Acl for CakePHP 2.x
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.
I'm using your plugin on my cakephp 2.5.3 applications. I get everything to work except the Update ACOs section. No errors no nothing just returns to the requester page. If I create my ACOs with AclExtras your plugin works but I want to use the feature that will ignore certain methods in my controllers.
Any ideas as to why it's not working?
When using Aros with personalized primary key's this changed should be done:
In AclController.php line 146 add:
$this->set('aroPk', $Aro->primaryKey );
in permissions.ctp change from line 29:
$inherit = $this->Form->value("Perms." . str_replace("/", ":", $action) . ".{$aroAlias}:{$aro[$aroAlias][$aroPk]}-inherit");
$allowed = $this->Form->value("Perms." . str_replace("/", ":", $action) . ".{$aroAlias}:{$aro[$aroAlias][$aroPk]}");
and line 33:
Form->select("Perms." . str_replace("/", ":", $action) . ".{$aroAlias}:{$aro[$aroAlias][$aroPk]}", array(array('inherit' => __('Inherit'), 'allow' => __('Allow'), 'deny' => __('Deny'))), array('empty' => __('No change'), 'value' => $value)); ?>Si interesse quelqu'un, j'ai traduit rapidement l'interface.
Super plugin
When pressing "Update ACOs", it should update then the first time and report "0 acos updated" the following times. But it always find some ACOs to update.
The bug is on AclController.php, line 212:
$aco = substr($aco, 0, -1); // Remove trailing slash
Sometimes the $aco string doesn't bring a trailing slash, so it's wrongly altered.
Here's the fix:
if (substr($aco, -1) == '/') {
$aco = substr($aco, 0, -1); // Remove trailing slash
}
Hello,
Since the $this->Auth->allow() was not used, so how to allow some action for not logged user like register, forget_password.
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
Hi,
I am very new for cakephp
Can you explain little bit more how to use step 1 and 4.
Getting error Table aros_acos for model Permission was not found in datasource default.
Please,
This is happened when i download the zipball.
error message: Parse error: syntax error, unexpected T_VARIABLE in /Library/WebServer/Documents/bt1m/app/Plugin/AclManager/Controller/AclController.php on line 143
solution:
adding " ; " at line 142 solved the issue.
thanks
AclManager/Controller/AclController.php line 136
$aroId = $aro[$Aro->alias]['id'];
I think it should be
$aroId = $aro[$Aro->alias][$Aro->primaryKey];
for those aro models which do not use id
as primary key
Hello i'm having this issue while trying to manage permissions:
Error: Maximum execution time of 120 seconds exceeded
File: E:\wamp\www\cake\lib\Cake\Utility\Debugger.php
Line: 562
Please could anyone help !
Thanks
Hi
Since I started the AclManager I couldn't log into my application. and I alwys got false from login() methode. In order to resolve the probleme i digged into cakephp core files specially in FormAuthenticate and I found out that there is a problem in $settings variable : $this->settings['fields']['username'] issues login as a field which is not expected. I think what we shoud do here is using keys of $this->settings['fields'] instead of its values.
The version of is cakephp 2.10
Any idea? or it's a misunderstanding from my side?
When i commented as:
protected function _getControllers() {
// Getting Cake controllers
// Not use
/*
$objects = array('Cake' => array());
$objects['Cake'] = App::objects('Controller');
$unsetIndex = array_search("AppController", $objects['Cake']);
if ($unsetIndex !== false) {
unset($objects['Cake'][$unsetIndex]);
}*/
// App::objects does not return PagesController
// Not use
/*if (!in_array('PagesController', $objects['Cake'])) {
array_unshift($objects['Cake'], 'PagesController');
}
*/
It work fine for plugin.
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'parentNode' at line 1
I use CakePHP 2.2.3, mamp server pro 2.1.1
What have I done wrong?
I've recently installed Acl Manager, and so far it is a great tool. It is already saving me a ton of time. Although, I have noticed that If I am at a /acl_manager/acl page all of my urls suddenly have acl_manager prepended to the controller.
For example if I am at acl_manager/acl/permissions and I want to navigate to my users index, my users url is now www.mysite.com/acl_manager/users/index which throws an error cause the acl_manager controller does not have a method for users.
My navigation looks like:
$this->Html->link(__('Users'), array('controller' => 'users', 'action' => 'index'))
Is there some thing I have to change in my routing or how can I go about avoiding adding acl_manager to all my urls.
Thanks for the help!
Unable to allow public access for unauthorised members.
What is the best way to handle public access?
As CakePHP 2.1 uses exceptions for error handling in many functions instead of returning FALSE, the update_aros function is failing.
AclController.php, line 279:
$node = $Model->node();
If the node lookup fails it will throw a CakeException that must be caught. So the fix is:
try {
$node = $Model->node();
} catch (CakeException $e) {
$node = false;
}
Missing Database Table
Error: Table acls for model Acl was not found in datasource default.
Using CakePHP v2.6.2
Hi,
This is great plugin but there is a problem when you have too many ACOs and AROs.
I have 359 ACOs in my App and 4 Groups (ARO). Plugin is changing permissions only for first 3 Groups, 4th group permissions are unchanged... I have noticed that this issue is related to number of ACOs and AROs....
reg.
gom3s
Hi,
Since update to CakePHP 2.3.1, ACO can't be generated...
In AclController.php, function _action (l. 377), i have an error because Cake requires a CakeRequest object and not an array.
I tried many thing but i can't resolve this problem...
Argument 1 passed to BaseAuthorize::action() must be an instance of CakeRequest ... Plugin/AclManager/Controller/AclController.php on line 386 and defined [CORE/Cake/Controller/Component/Auth/BaseAuthorize.php, line 112]
Can you help me to solve my problem ? Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.