public function actionUp($id)
    {
        $product = Product::findOne($id);
        if (\Yii::$app->user->can('updateProduct', ['productOwner' => $product->owner])) {
            if (!empty($product)) {
                /**
                 * @var $product PositionBehavior
                 */
                $product->movePrev();
                $this->trigger(self::EVENT_AFTER_EDIT_PRODUCT, new ProductEvent(['id' => $id]));
            }
            return $this->redirect(\Yii::$app->request->referrer);
        } else throw new ForbiddenHttpException(\Yii::t('shop', 'You have not permission to do this action.'));
    }
public function actionUp($id)
    {
        $product = Product::findOne($id);
        if (\Yii::$app->user->can('updateProduct', ['productOwner' => $product->owner])) {
            if (!empty($product)) {
                /**
                 * @var $product PositionBehavior
                 */
                $product->movePrev();
                $this->trigger(self::EVENT_AFTER_EDIT_PRODUCT, new ProductEvent(['id' => $id]));
            }
            return $this->redirect(\Yii::$app->request->referrer);
        } else throw new ForbiddenHttpException(\Yii::t('shop', 'You have not permission to do this action.'));
    }
public function actionUp ( $ id ) { $ product = Product :: findOne ( $ id ) ; if ( \ Yii :: $ app -> user -> can ( 'updateProduct' , [ 'productOwner' => $ product -> owner ] ) ) { if ( ! empty ( $ product ) ) { /**
                 * @var $product PositionBehavior
                 */ $ product -> movePrev ( ) ; $ this -> trigger ( self :: EVENT_AFTER_EDIT_PRODUCT , new ProductEvent ( [ 'id' => $ id ] ) ) ; } return $ this -> redirect ( \ Yii :: $ app -> request -> referrer ) ; } else throw new ForbiddenHttpException ( \ Yii :: t ( 'shop' , 'You have not permission to do this action.' ) ) ; }
Changes product position to up

Users which have 'updateOwnProduct' permission can change position only for Product models that have been created by their.
Users which have 'updateProduct' permission can change position for all Product models.

@param integer $id
@return mixed
@throws ForbiddenHttpException
Changes product position to up