/** * Check to see if current user has permission to see project * * @param int $project_id * @return bool */ public function project_permission($project_id = null) { if (is_null($project_id)) { $project_id = Project::current()->id; } if ($this->permission('project-all')) { return true; } if (Project\User::check_assign($this->id, $project_id)) { return true; } return false; }