From f595fb2786d884dbaf7ec87d53cee920a0655f0e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 29 Jul 2015 17:42:48 -0400 Subject: Add first draft of the user api --- app/Api/Project.php | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'app/Api/Project.php') diff --git a/app/Api/Project.php b/app/Api/Project.php index 4e4e10b8..c3ae503c 100644 --- a/app/Api/Project.php +++ b/app/Api/Project.php @@ -12,6 +12,7 @@ class Project extends Base { public function getProjectById($project_id) { + $this->checkProjectPermission($project_id); return $this->formatProject($this->project->getById($project_id)); } @@ -82,28 +83,4 @@ class Project extends Base list($valid,) = $this->project->validateModification($values); return $valid && $this->project->update($values); } - - private function formatProject($project) - { - if (! empty($project)) { - $project['url'] = array( - 'board' => $this->helper->url->to('board', 'show', array('project_id' => $project['id']), '', true), - 'calendar' => $this->helper->url->to('calendar', 'show', array('project_id' => $project['id']), '', true), - 'list' => $this->helper->url->to('listing', 'show', array('project_id' => $project['id']), '', true), - ); - } - - return $project; - } - - private function formatProjects($projects) - { - if (! empty($projects)) { - foreach ($projects as &$project) { - $project = $this->formatProject($project); - } - } - - return $projects; - } } -- cgit v1.2.3