|
|
@@ -81,7 +81,7 @@ class Permission extends AppModel {
|
|
|
* @param string $action Action (defaults to *)
|
|
|
* @return boolean Success (true if ARO has access to action in ACO, false otherwise)
|
|
|
*/
|
|
|
- public function check($aro, $aco, $action = "*") {
|
|
|
+ public function check($aro, $aco, $action = '*') {
|
|
|
if (!$aro || !$aco) {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -92,7 +92,8 @@ class Permission extends AppModel {
|
|
|
|
|
|
if (!$aroPath || !$acoPath) {
|
|
|
trigger_error(__d('cake_dev',
|
|
|
- "DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: %s\nAco: %s",
|
|
|
+ "%s - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: %s\nAco: %s",
|
|
|
+ 'DbAcl::check()',
|
|
|
print_r($aro, true),
|
|
|
print_r($aco, true)),
|
|
|
E_USER_WARNING
|
|
|
@@ -102,7 +103,8 @@ class Permission extends AppModel {
|
|
|
|
|
|
if (!$acoPath) {
|
|
|
trigger_error(__d('cake_dev',
|
|
|
- "DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: %s\nAco: %s",
|
|
|
+ "%s - Failed ACO node lookup in permissions check. Node references:\nAro: %s\nAco: %s",
|
|
|
+ 'DbAcl::check()',
|
|
|
print_r($aro, true),
|
|
|
print_r($aco, true)),
|
|
|
E_USER_WARNING
|
|
|
@@ -111,7 +113,7 @@ class Permission extends AppModel {
|
|
|
}
|
|
|
|
|
|
if ($action !== '*' && !in_array('_' . $action, $permKeys)) {
|
|
|
- trigger_error(__d('cake_dev', "ACO permissions key %s does not exist in DbAcl::check()", $action), E_USER_NOTICE);
|
|
|
+ trigger_error(__d('cake_dev', "ACO permissions key %s does not exist in %s", $action, 'DbAcl::check()'), E_USER_NOTICE);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -176,20 +178,20 @@ class Permission extends AppModel {
|
|
|
* @return boolean Success
|
|
|
* @throws AclException on Invalid permission key.
|
|
|
*/
|
|
|
- public function allow($aro, $aco, $actions = "*", $value = 1) {
|
|
|
+ public function allow($aro, $aco, $actions = '*', $value = 1) {
|
|
|
$perms = $this->getAclLink($aro, $aco);
|
|
|
$permKeys = $this->getAcoKeys($this->schema());
|
|
|
$save = array();
|
|
|
|
|
|
if (!$perms) {
|
|
|
- trigger_error(__d('cake_dev', 'DbAcl::allow() - Invalid node'), E_USER_WARNING);
|
|
|
+ trigger_error(__d('cake_dev', '%s - Invalid node', 'DbAcl::allow()'), E_USER_WARNING);
|
|
|
return false;
|
|
|
}
|
|
|
if (isset($perms[0])) {
|
|
|
$save = $perms[0][$this->alias];
|
|
|
}
|
|
|
|
|
|
- if ($actions === "*") {
|
|
|
+ if ($actions === '*') {
|
|
|
$save = array_combine($permKeys, array_pad(array(), count($permKeys), $value));
|
|
|
} else {
|
|
|
if (!is_array($actions)) {
|