Issues (42)

api/v1/class.RoleAPI.php (1 issue)

Severity
1
<?php
2
class RoleAPI extends VolunteerAPI
3
{
4
    use Processor;
0 ignored issues
show
The trait Processor requires some properties which are not provided by RoleAPI: $startTime, $certs, $endTime, $mail, $uid, $title
Loading history...
5
6
    public function __construct()
7
    {
8
        parent::__construct('roles', 'short_name');
9
    }
10
11
    protected function canEditDept($request, $deptId)
12
    {
13
        if($this->isVolunteerAdmin($request))
14
        {
15
            return true;
16
        }
17
        return $this->isUserDepartmentLead($deptId, $this->user);
18
    }
19
20
    protected function canUpdate($request, $entity)
21
    {
22
        return $this->canEditDept($request, $entity['departmentID']);
23
    }
24
25
    protected function canDelete($request, $entity)
26
    {
27
        return $this->canUpdate($request, $entity);
28
    }
29
30
    protected function processEntry($entry, $request)
31
    {
32
        return $this->processRole($entry, $request);
33
    }
34
}
35
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
36