$oidlist = join(',', $oidlist);
$sql = <<<SQL
-select objectid as id, action, cascade, allow
+select objectid as id, action, cascader, allow
from
acl
where
role in ($role_list)
and objectid in ($oidlist)
order by
- cascade desc,
+ cascader desc,
seq asc
SQL
;
if (!isset($res_by_oid[$oid])) continue;
foreach ($res_by_oid[$oid] as $row) {
- if ($row['id'] == $objectid && $row['cascade']) {
+ if ($row['id'] == $objectid && $row['cascader']) {
/* ignore items below the object of interest */
continue;
}
* If entries is an empty array, or not an array, then the appropriate
* ACL will be removed.
*/
- static public function setACL($object, $cascade, $entries)
+ static public function setACL($object, $cascader, $entries)
{
self::$cache = array();
- $cascade = (int)$cascade;
- MTrackDB::q('delete from acl where objectid = ? and cascade = ?',
- $object, $cascade);
+ $cascader = (int)$cascader;
+ MTrackDB::q('delete from acl where objectid = ? and cascader = ?',
+ $object, $cascader);
$seq = 0;
if (is_array($entries)) {
foreach ($entries as $ent) {
} else {
list($role, $action, $allow) = $ent;
}
- MTrackDB::q('insert into acl (objectid, cascade, seq, role,
+ MTrackDB::q('insert into acl (objectid, cascader, seq, role,
action, allow) values (?, ?, ?, ?, ?, ?)',
- $object, $cascade, $seq++,
+ $object, $cascader, $seq++,
$role, $action, (int)$allow);
}
}
}
/* Obtains the ACL entries for the specified object.
- * If cascade is true, it will return the inheritable ACL.
+ * If cascader is true, it will return the inheritable ACL.
*/
- static public function getACL($object, $cascade)
+ static public function getACL($object, $cascader)
{
return MTrackDB::q('select role, action, allow from acl
- where objectid = ? and cascade = ? order by seq',
- $object, (int)$cascade)->fetchAll(PDO::FETCH_ASSOC);
+ where objectid = ? and cascader = ? order by seq',
+ $object, (int)$cascader)->fetchAll(PDO::FETCH_ASSOC);
}
static public function hasAllRights($object, $rights)