/** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { if (AuthHelper::authenticate() == 'admin') { return true; } return false; }
public static function authenticate() { Cas::authenticate(); $role = AuthHelper::getRole(Cas::user()); return $role; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($video) { $del_vid = video_base_path . '/' . $video->vid_url; if (AuthHelper::authenticate() == 'admin') { if (file_exists($del_vid)) { unlink($del_vid); } $video->delete(); } return redirect('videos'); }