Creates new permission attached to $id owner.
@param integer $id parent id
@return \yii\web\View action view
348873
public function actionAdd($id, $parent_id, $add = 1)
    {
        $parent = $this->findParentModel($parent_id);
        $model = $this->findParentModel();
        $model->type = Item::TYPE_PERMISSION;
        $model->name = $id;
        if ((!$child = $model::findOne($id)) && $add) {
            $child = $model;
        }
        if ($add) {
            $parent->addChild($child);
        } else if ($child){
            $parent->removeChild($child);
        }
    }
1284898
public function update(CreatePermission $request, $id)
    {
        $permission = Permission::findOrFail($id);
		$permission->name = $request->name;
		$permission->code = $request->code;
		$permission->permission_group_id = $request->permission_group_id;
		$permission->save();
		
		return redirect(url("permission"))->with('dp_announce', trans('deeppermission.alert.permission.updated'));
    }
172011
public function show($id)
    {
        // get permission by id
        $permission = Permission::find($id);

        if (!$permission) {
            return response()->json(null, 404);
        }

        return response()->json(arrayView('phpsoft.users::permission/read', [
            'permission' => $permission
        ]), 200);
    }
1056018
public function edit($id)
    {
        $user = $this->service->find($id);
        return view('admin.users.edit')->with('user', $user);
    }
410051
public function view($id = null)
    {
        $role = $this->Roles->get($id, [
            'contain' => []
        ]);
        $this->set('role', $role);

        $this->render(Configure::read('CM.AdminRoleViews.view'));
    }
759486
public function actionView(string $id)
    {
        $model = $this->findModel($id);

        return $this->render('view', ['model' => $model]);
    }
1039889
public function actionView($id)
	{
		$user = \App::$domain->account->login->oneById($id);
		$model = new Assignment($id, $user);
		return $this->render('view', [
			'model' => $model,
			'idField' => $this->idField,
			'usernameField' => $this->usernameField,
			'fullnameField' => $this->fullnameField,
		]);
	}
14937
public function getById($id)
    {
        return new View(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(),$this->getResourcePath(),"getById",array($id))
        );
    }
273440
public function view(string $id = null)
    {
        $permission = $this->Permissions->get($id);

        $this->set('permission', $permission);
        $this->set('_serialize', ['permission']);
    }
1168464
public function actionView ($id)
		{
			$page = Page::find()->where([ 'id' => $id ])->orWhere([ 'guid' => $id ])->one();
			if ($page === null)
			{
				Yii::$app->notification->errorToSession(Yii::tr('Given page does not exist.', [], 'page'));
				$this->redirect(Url::toRoute([ '/page/index' ]));
			}
			$this->setTitle(Yii::tr('View page', [], 'page'));
			$this->data('page', $page);
			$this->data('useMenu', $this->module->useMenu);
			$this->_tpl = '@pageViews/view';
		}
389577
public function actionView($id)
    {
        $model = $this->findModel($id);
        $this->fire('view', [$model]);
        return $model;
    }
1068312
public function show($id)
    {
      $role = Role::with('permissions')->findOrFail($id);
      return \View::make('admin.roles.show', compact('role'));
    }
329671
public function editPermission(array $data = [], $id = null)
    {
        if (!empty($id)) {
            $data['id'] = $id;
        }
        try{
            return $this->createPermission($data);
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
    }
634982
public function view($id = null)
    {
        $cmsPermission = $this->CmsPermission->get($id, [
            'contain' => ['CmsTerm', 'CmsContent']
        ]);
        $this->set('cmsPermission', $cmsPermission);
        $this->set('_serialize', ['cmsPermission']);
    }
868916
public function actionAssign($id)
    {
        $model = Yii::createObject([
            'class'   => Assignment::className(),
            'user_id' => $id,
        ]);

        if ($model->load(\Yii::$app->request->post()) && $model->updateAssignments()) {
        }

        return \matacms\rbac\widgets\Assignments::widget([
            'model' => $model,
        ]);
        /*$model = Yii::createObject([
            'class'   => Assignment::className(),
            'user_id' => $id,
        ]);

        if ($model->load(Yii::$app->request->post()) && $model->updateAssignments()) {

        }

        return $this->render('assign', [
            'model' => $model,
        ]);*/
    }
1115813
public function hasPermission($id)
    {
        if ($id instanceof Eloquent)
            $id = $id->getKey();

        return $this->permissions->contains('id', $id);
    }
164523
public function edit($id)
    {
        $permission = $this->permissions->find($id);

        if ( $permission )
        {
            return View::make( Config::get('cpanel::views.permissions_edit') )
                ->with('permission', $permission);
        }
        else
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('error', Lang::get('cpanel::permissions.model_not_found'));
        }
    }