summaryrefslogtreecommitdiff
path: root/app/Api/ProjectPermission.php
blob: d4408197c5dbebaa40ce55e627846f51e3f70376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

namespace Kanboard\Api;

use Kanboard\Core\Security\Role;

/**
 * ProjectPermission API controller
 *
 * @package  api
 * @author   Frederic Guillot
 */
class ProjectPermission extends \Kanboard\Core\Base
{
    public function getMembers($project_id)
    {
        return $this->projectUserRole->getAllUsers($project_id);
    }

    public function revokeUser($project_id, $user_id)
    {
        return $this->projectUserRole->removeUser($project_id, $user_id);
    }

    public function allowUser($project_id, $user_id)
    {
        return $this->projectUserRole->addUser($project_id, $user_id, Role::PROJECT_MEMBER);
    }
}