AclManager icon indicating copy to clipboard operation
AclManager copied to clipboard

Aro Primary Key on permissions.ctp with special primary key

Open tranfuga25s opened this issue 11 years ago • 3 comments

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 avatar Feb 16 '14 15:02 tranfuga25s

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.

tranfuga25s avatar Feb 16 '14 16:02 tranfuga25s

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

FMCorz avatar Feb 20 '14 12:02 FMCorz

Any chance to get attention to the merge request?

tranfuga25s avatar Sep 23 '14 17:09 tranfuga25s