Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function get($id) |
||
44 | { |
||
45 | if(! DolibarrApiAccess::$user->rights->propal->lire) { |
||
46 | throw new RestException(401); |
||
47 | } |
||
48 | |||
49 | $result = $this->flight->fetch($id); |
||
50 | if( ! $result ) { |
||
51 | throw new RestException(404, 'Flight not found'); |
||
52 | } |
||
53 | |||
54 | if( ! DolibarrApi::_checkAccessToResource('flight',$this->flight->id)) { |
||
55 | throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); |
||
56 | } |
||
57 | |||
58 | return $this->_cleanObjectDatas($this->flight); |
||
59 | } |
||
60 | } |