From ad8fcf035ab92d8cd06179959000b9a1681b1505 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 22 Jan 2016 21:23:12 -0500 Subject: Add new API procedures for groups, roles and project permissions --- app/Api/Group.php | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/Api/Group.php (limited to 'app/Api/Group.php') diff --git a/app/Api/Group.php b/app/Api/Group.php new file mode 100644 index 00000000..a1e0a73d --- /dev/null +++ b/app/Api/Group.php @@ -0,0 +1,49 @@ +group->create($name, $external_id); + } + + public function updateGroup($group_id, $name = null, $external_id = null) + { + $values = array( + 'id' => $group_id, + 'name' => $name, + 'external_id' => $external_id, + ); + + foreach ($values as $key => $value) { + if (is_null($value)) { + unset($values[$key]); + } + } + + return $this->group->update($values); + } + + public function removeGroup($group_id) + { + return $this->group->remove($group_id); + } + + public function getGroup($group_id) + { + return $this->group->getById($group_id); + } + + public function getAllGroups() + { + return $this->group->getAll(); + } +} -- cgit v1.2.3