Checks if user is allowed to edit in this shop.

@param int $shopId shop id

@return bool
491804
protected function isAllowedToEdit($shopId)
    {
        $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        $user->loadAdminUser();

        if ($user->oxuser__oxrights->value == "malladmin" || $user->oxuser__oxrights->value == (int) $shopId) {
            return true;
        }

        return false;
    }
854197
public function get($shopId)
    {
        $resource = 'shop/' . $shopId . '.json';
        $response = $this->getServiceResponse($resource);

        $getShopResponse = new Models\ResponseShopGet($response);

        return $getShopResponse->getShop();
    }
1194595
static public function isEditor($request)
    {
        if (! User_Precondition::isLogedIn($request)){
            return false;
        }
        if ($request->user->hasPerm('tenant.owner') || $request->user->hasPerm('cms.editor')) {
            return true;
        }
        return false;
    }
658381
private function isActiveExtension(
        string              $classExtension,
        int                 $shopId,
        ShopConfiguration   $shopConfiguration
    ): bool {

        foreach ($shopConfiguration->getModuleConfigurations() as $moduleConfiguration) {
            if ($moduleConfiguration->hasClassExtension($classExtension)
                && $this->moduleStateService->isActive($moduleConfiguration->getId(), $shopId)
            ) {
                return true;
            }
        }

        return false;
    }
759488
protected function _getShop($langId = null, $shopId = null)
    {
        if ($langId === null && $shopId === null) {
            if (isset($this->_oShop)) {
                return $this->_oShop;
            } else {
                return $this->_oShop = Registry::getConfig()->getActiveShop();
            }
        }

        $myConfig = Registry::getConfig();

        $shop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class);
        if ($shopId !== null) {
            $shop->setShopId($shopId);
        }
        if ($langId !== null) {
            $shop->setLanguage($langId);
        }
        $shop->load($myConfig->getShopId());

        return $shop;
    }
461251
public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('EcommerceBundle:Advert')->find($id);
        $purchase = $em->getRepository('EcommerceBundle:ProductPurchase')->findOneByAdvert($entity);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Advert entity.');
        }

        $form = $this->createEditForm($entity);
        
        return array(
            'entity'      => $entity,
            'purchase'   => $purchase,
            'form' => $form->createView(),
        );
    }
820401
function isEditable() {
        if($this->managed) {
            return false;
        }
        
        $member = $this->guild->me;
        if(!$member->permissions->has(\CharlotteDunois\Yasmin\Models\Permissions::PERMISSIONS['MANAGE_ROLES'])) {
            return false;
        }
        
        return ($member->getHighestRole()->comparePositionTo($this) > 0);
    }
252988
protected function check_edit_permission( $comment ) {
		if ( 0 === (int) get_current_user_id() ) {
			return false;
		}

		if ( ! current_user_can( 'moderate_comments' ) ) {
			return false;
		}

		return current_user_can( 'edit_comment', $comment->comment_ID );
	}
1280845
public function isMod($userId = null)
    {
        return (new Query())->from(Mod::tableName())->where(['forum_id' => $this->id, 'user_id' => $userId])->exists();
    }
380791
protected function isEditOnlyResponse()
    {
        if ($this->getEnvironment()->getDataDefinition()->getBasicDefinition()->isEditOnlyMode()) {
            $this->callAction('edit');

            return true;
        }

        return false;
    }
550857
public function edit($id)
    {
        if (!$role = $this->roleRepositoryInterface->getById($id)) {
            Flash::error(trans('dashboard::dashboard.errors.role.found'));

            return redirect()->route('roles.index');
        }

        $permissions = $this->permissionRepositoryInterface->getAll();

        return $this->view('roles.edit')->with(['role' => $role, 'permissions' => $permissions]);
    }
879716
public function canDelete($user_id)
    {
        if ($this->isSuperadmin($user_id)) {
            return false;
        }

        $result = $this->db->fetchColumn('SELECT * FROM orders WHERE user_id=?', array($user_id));
        return empty($result);
    }
643746
protected function canUpdate() {        
        $user_id = Filter::postInteger('userid', -1) ?: Filter::getInteger('userid', -1);
        return Auth::check() && 
            ( 
                $user_id == Auth::user()->getUserId() ||        // Allow update for yourself
                ($user_id == -1 && Auth::isManager(Globals::getTree()))   // Allow a manager to update the default user
             );
    }
602734
public function doesCartWithIdExist(string $cartId): bool
    {
        $qb = $this->connection->createQueryBuilder();
        $qb->select('COUNT(*)')
            ->from('dumplie_customer_cart')
            ->where('id = :id')
            ->setParameter('id', $cartId)
            ->getSQL();

        return (bool)$this->connection->fetchColumn($qb->getSQL(), $qb->getParameters());
    }
35237
public function isEditable()
    {
        return $this->read_only || $this->never_persist
            ? false
            : (isset($this->ui['editable']) ? $this->ui['editable'] : !$this->system);
    }
62070
public function edit($id)
	{
		// SECURITY:
		// if edit_permission is false, abort
		if (isset($this->crud['edit_permission']) && !$this->crud['edit_permission']) {
			abort(403, 'Not allowed.');
		}

		// get the info for that entry
		$model = $this->crud['model'];
		$this->data['entry'] = $model::find($id);
		$this->data['entry']->addFakes($this->getFakeColumnsAsArray());

		if (isset($this->data['crud']['update_fields']))
		{
			$this->crud['fields'] = $this->data['crud']['update_fields'];
		}

		// prepare the fields you need to show and prepopulate the values
		$this->prepareFields($this->data['entry']);
		$this->data['crud'] = $this->crud;

		// load the view from /resources/views/vendor/dick/crud/ if it exists, otherwise load the one in the package
		return $this->firstViewThatExists('vendor.dick.crud.edit', 'crud::edit', $this->data);
	}
241279
public function deleteShopConfiguration(int $shopId)
    {
        if (array_key_exists($shopId, $this->shopConfigurations)) {
            unset($this->shopConfigurations[$shopId]);
        } else {
            throw new DomainException('There is no configuration for shop id ' . $shopId);
        }
    }