function getACLByPath($path) { $retacl = new ACL(); if ($this->is_su == "1") { $retacl->acl_id = 1; $retacl->delete_path = "1"; $retacl->write_path = "1"; $retacl->read_path = "1"; $retacl->rename_path = "1"; $retacl->delete_file = "1"; $retacl->write_file = "1"; $retacl->read_file = "1"; $retacl->rename_file = "1"; return $retacl; } $done = false; $acllist = new ACLList(); $curacls = array(); $currentUserId = $this->user_id; while (!$done) { $currentUser = new User(); if (!$currentUser->selectById($currentUserId)) { $done = true; } else { if ($acllist->selectByUserIdAndPath($currentUser->user_id, $path)) { $curacls = $acllist->list; } if (count($curacls) == 0) { $currentUserId = $currentUser->user_id_parent; } else { $done = true; $retacl->initializeFromRow($curacls[0]); } } } return $retacl; }