@@ -923,64 +923,6 @@ public function beforeDelete()
923
923
}
924
924
925
925
/**
926
- <<<<<<< HEAD
927
- * Get user context.
928
- *
929
- * @return UserContextInterface
930
- */
931
- private function getUserContext (): UserContextInterface
932
- {
933
- if (!$ this ->userContext ) {
934
- $ this ->userContext = ObjectManager::getInstance ()->get (UserContextInterface::class);
935
- }
936
-
937
- return $ this ->userContext ;
938
- }
939
-
940
- /**
941
- * Get authorization service.
942
- *
943
- * @return AuthorizationInterface
944
- */
945
- private function getAuthorization (): AuthorizationInterface
946
- {
947
- if (!$ this ->authorization ) {
948
- $ this ->authorization = ObjectManager::getInstance ()->get (AuthorizationInterface::class);
949
- }
950
-
951
- return $ this ->authorization ;
952
- }
953
-
954
- /**
955
- * @inheritDoc
956
- * @since 103.0.2
957
- */
958
- public function beforeSave ()
959
- {
960
- //Validate changing of design.
961
- $ userType = $ this ->getUserContext ()->getUserType ();
962
- if ((
963
- $ userType === UserContextInterface::USER_TYPE_ADMIN
964
- || $ userType === UserContextInterface::USER_TYPE_INTEGRATION
965
- )
966
- && !$ this ->getAuthorization ()->isAllowed ('Magento_Catalog::edit_category_design ' )
967
- ) {
968
- foreach ($ this ->_designAttributes as $ attributeCode ) {
969
- $ this ->setData ($ attributeCode , $ value = $ this ->getOrigData ($ attributeCode ));
970
- if (!empty ($ this ->_data [self ::CUSTOM_ATTRIBUTES ])
971
- && array_key_exists ($ attributeCode , $ this ->_data [self ::CUSTOM_ATTRIBUTES ])) {
972
- //In case custom attribute were used to update the entity.
973
- $ this ->_data [self ::CUSTOM_ATTRIBUTES ][$ attributeCode ]->setValue ($ value );
974
- }
975
- }
976
- }
977
-
978
- return parent ::beforeSave ();
979
- }
980
-
981
- /**
982
- =======
983
- >>>>>>> 2.3.4-develop
984
926
* Retrieve anchors above
985
927
*
986
928
* @return array
0 commit comments