コード例 #1
0
ファイル: GroupController.php プロジェクト: h0akd/corecms
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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));
 }
コード例 #3
0
ファイル: HomeController.php プロジェクト: h0akd/corecms
 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;
 }