diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-29 17:42:48 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-29 17:42:48 -0400 |
commit | f595fb2786d884dbaf7ec87d53cee920a0655f0e (patch) | |
tree | 0da808ef2f679affa51eff80e172787098c13731 /app/Api/Project.php | |
parent | 2eeb58ae0321f584652714080649302c3f83a831 (diff) |
Add first draft of the user api
Diffstat (limited to 'app/Api/Project.php')
-rw-r--r-- | app/Api/Project.php | 25 |
1 files changed, 1 insertions, 24 deletions
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; - } } |