Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aro Primary Key on permissions.ctp with special primary key #18

Open
tranfuga25s opened this issue Feb 16, 2014 · 3 comments
Open

Aro Primary Key on permissions.ctp with special primary key #18

tranfuga25s opened this issue Feb 16, 2014 · 3 comments

Comments

@tranfuga25s
Copy link

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)); ?>
@tranfuga25s
Copy link
Author

Also in AclController.php line 324 should take the $Model->primaryKey, if not it will create all ARO's with NULL foreign_key's:

$item = $item[$Model->alias];
$Model->create();
$Model->id = $item[$Model->primaryKey];

Should checkout also that the parent node has hardcoded primaryKey name.

@FMCorz
Copy link
Owner

FMCorz commented Feb 20, 2014

Thanks. If you feel like submitting a Pull Request it would be much appreciated.
Cheers,
Fred

@tranfuga25s
Copy link
Author

Any chance to get attention to the merge request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants