/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $modules = Module::all(); $permistions = Permistion::all(); $model = Group::find($id); return View::make("CoreCms::group.edit")->with("model", $model)->with("modules", $modules)->with("permistions", $permistions); }
/** * Remove the specified resource fr om storage. * * @param int $id * @return Response */ public function destroy($id) { $model = Permistion::findOrFail($id); return json_encode($model->delete() ? array("code" => 1) : array("code" => 0)); }
private function hasPermistionAccesModule($user, $moduleAlias) { $permistions = \H0akd\Corecms\Models\Permistion::all(); foreach ($permistions as $permistion) { if ($user->hasAccess("{$moduleAlias}.{$permistion->alias}")) { return true; } } return false; }