/** * return a boolean on whether or not this department * has admin right to the file whose ID is $data_id * @param int $data_id * @return bool */ public function canAdmin($data_id) { $filedata = new FileData($data_id, $this->connection); //check to see if this department doesn't have a forbidden right or //if this file is publishable if (!$this->isForbidden($data_id) or !$filedata->isPublishable()) { // return whether or not this deptartment can admin the file if ($this->canDept($data_id, $this->ADMIN_RIGHT)) { return true; } else { false; } } }
/** * return whether if this user can admin $data_id * @param $data_id * @return bool */ function canAdmin($data_id) { $filedata = new FileData($data_id, $this->connection); if (!$this->isForbidden($data_id) or !$filedata->isPublishable()) { if ($this->canUser($data_id, $this->ADMIN_RIGHT) or $this->dept_perms_obj->canAdmin($data_id) or $filedata->isOwner($this->id)) { return true; } else { false; } } }