summaryrefslogtreecommitdiff
path: root/app/Api/ProjectPermission.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-22 21:23:12 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-22 21:23:12 -0500
commitad8fcf035ab92d8cd06179959000b9a1681b1505 (patch)
tree80f4e35b16c1c1a6d4c473983bc6cb62b9519494 /app/Api/ProjectPermission.php
parentf27bcec2d92af83ee7205c84954cda9d7b2fc55d (diff)
Add new API procedures for groups, roles and project permissions
Diffstat (limited to 'app/Api/ProjectPermission.php')
-rw-r--r--app/Api/ProjectPermission.php51
1 files changed, 47 insertions, 4 deletions
diff --git a/app/Api/ProjectPermission.php b/app/Api/ProjectPermission.php
index d4408197..11e92af0 100644
--- a/app/Api/ProjectPermission.php
+++ b/app/Api/ProjectPermission.php
@@ -5,25 +5,68 @@ namespace Kanboard\Api;
use Kanboard\Core\Security\Role;
/**
- * ProjectPermission API controller
+ * Project Permission API controller
*
* @package api
* @author Frederic Guillot
*/
class ProjectPermission extends \Kanboard\Core\Base
{
- public function getMembers($project_id)
+ public function getProjectUsers($project_id)
{
return $this->projectUserRole->getAllUsers($project_id);
}
- public function revokeUser($project_id, $user_id)
+ public function getAssignableUsers($project_id, $prepend_unassigned = false)
+ {
+ return $this->projectUserRole->getAssignableUsersList($project_id, $prepend_unassigned);
+ }
+
+ public function addProjectUser($project_id, $user_id, $role = Role::PROJECT_MEMBER)
+ {
+ return $this->projectUserRole->addUser($project_id, $user_id, $role);
+ }
+
+ public function addProjectGroup($project_id, $group_id, $role = Role::PROJECT_MEMBER)
+ {
+ return $this->projectGroupRole->addGroup($project_id, $group_id, $role);
+ }
+
+ public function removeProjectUser($project_id, $user_id)
{
return $this->projectUserRole->removeUser($project_id, $user_id);
}
+ public function removeProjectGroup($project_id, $group_id)
+ {
+ return $this->projectGroupRole->removeGroup($project_id, $group_id);
+ }
+
+ public function changeProjectUserRole($project_id, $user_id, $role)
+ {
+ return $this->projectUserRole->changeUserRole($project_id, $user_id, $role);
+ }
+
+ public function changeProjectGroupRole($project_id, $group_id, $role)
+ {
+ return $this->projectGroupRole->changeGroupRole($project_id, $group_id, $role);
+ }
+
+ // Deprecated
+ public function getMembers($project_id)
+ {
+ return $this->getProjectUsers($project_id);
+ }
+
+ // Deprecated
+ public function revokeUser($project_id, $user_id)
+ {
+ return $this->removeProjectUser($project_id, $user_id);
+ }
+
+ // Deprecated
public function allowUser($project_id, $user_id)
{
- return $this->projectUserRole->addUser($project_id, $user_id, Role::PROJECT_MEMBER);
+ return $this->addProjectUser($project_id, $user_id);
}
}