Last active
August 29, 2015 13:57
-
-
Save paulwsmith/9749872 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function beforeSave() { | |
$current_role_id; // = something... role that was set to false | |
foreach($data['read'] as $role_id => $value) { | |
if ($value == false) { | |
$record_permission_data = $this->RecordPermission->find(array( | |
'conditions' => array( | |
'scope' => $this->data['scope'] . '.Records' | |
) | |
)); | |
foreach ($record_permission_data as $crud => $role_data) { | |
$record_permission[$crud][$current_role_id] = false; | |
} | |
$this->RecordPermission->save($record_permission_data); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment