| Total Complexity | 7 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 3 | class VolunteerAPI extends Http\Rest\DataTableAPI |
||
| 4 | { |
||
| 5 | protected $isAdmin = null; |
||
| 6 | protected $isLead = null; |
||
| 7 | |||
| 8 | public function __construct($dataTableName, $idField = '_id') |
||
| 9 | { |
||
| 10 | parent::__construct('fvs', $dataTableName, $idField); |
||
| 11 | } |
||
| 12 | |||
| 13 | protected function isVolunteerAdmin($request) |
||
| 14 | { |
||
| 15 | $this->validateLoggedIn($request); |
||
| 16 | if($this->isAdmin === null) |
||
| 17 | { |
||
| 18 | $this->isAdmin = $this->user->isInGroupNamed('VolunteerAdmins'); |
||
| 19 | } |
||
| 20 | return $this->isAdmin; |
||
| 21 | } |
||
| 22 | |||
| 23 | protected function canCreate($request) |
||
| 24 | { |
||
| 25 | return $this->isVolunteerAdmin($request); |
||
| 26 | } |
||
| 27 | |||
| 28 | protected function addRequiredFilter($key, $id, $odata) |
||
| 45 | } |
||
| 46 | } |
||
| 47 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |
||
| 48 |