/** * [checkObligation description] * @param [type] $oblig [description] * @return [type] [description] */ public function checkObligation($oblig) { $rs = Obligation::where('obl_name', '=', $oblig)->count(); if (isset($rs)) { return $rs >= 1 ? false : true; } }
/** * [policyRBACEditFrmAction Show form for edit rbac-policy] * @param [integer] $id policy id * @return [none] redirect to view */ public function policyRBACEditFrmAction($id) { $data['policy'] = Policy::find($id); $data['role'] = Roles::all(); $data['data'] = Data::all(); $data['condition'] = Condition::all(); $data['action'] = Action::all(); $data['purpose'] = Purpose::all(); $data['obligation'] = Obligation::all(); // print '<pre>'; // print_r(self::policyRBACEditAction($id)); // exit(); return View::make('rbac.editrbac')->with('results', $data)->with('rbac_data', self::policyRBACEditAction($id)); }
/** * [delAction description] * @param [type] $id [description] * @return [type] [description] */ public function delAction($id) { Obligation::where('id', '=', $id)->delete(); return Redirect::to('obligation')->with('success', 'ข้อผูกพันรหัส = ' . $id . ' ลบทิ้งสำเร็จ'); }