/** * Return if no access and not the owner of the entity * * @param $permission * @param $entity * @return bool */ protected function noAccessNotOwner($permission, $entity) { if (\Bouncer::hasPermissionOrIsOwner($permission, $entity->user_id)) { return false; } return $this->noAccessReturn($entity); }
/** * Edit post * * @return $this|\Illuminate\Http\RedirectResponse */ public function postEdit() { if (!\Bouncer::hasPermissionOrIsOwner('forums.posts.edit', $this->post)) { return $this->cantEditPost(); } // Edit post return $this->editPostRequest->edit($this, \Input::all(), $this->post); }