vendrhub/vendr-deploy

Store User Permissions prevents content transfer

Closed this issue · 7 comments

We have a solution hosted on Umbraco Cloud, where editors have been given permissions to access a store, both by the User Groups and Users settings.

When trying to transfer any content that has a reference to the store, we get a schema mismatch on the store. The differences in source and target json, is in the AllowedUsers and AllowedUserRoles.

It kinda makes sense as Umbraco Users aren't transferred, so maybe User Permissions shouldn't be transferred either?

The full mismatch error is here (some information has been anonymized)

Schema mismatch
While trying to restore, we found schema mismatches between your environments. To be able to restore content, first make sure you have deployed all pending schema changes between your environments in the portal.

If you are still experiencing problems, please refer to the documentation on how to troubleshoot schema errors on Umbraco Cloud.

The following items are causing problems:

Vendr store StoreName with alias 'storealias'
umb://vendr-store/18ced013ad6b4a01848275bff5924cf2
Checksums differ.
Source checksum json: {"BaseCurrencyUdi":"umb://vendr-currency/5bfe58a5d76a4dd4a315e2503fb41da2","DefaultCountryUdi":"umb://vendr-country/a8fa6d7c1b384d3d9e1fe3790f3e79a8","DefaultTaxClassUdi":"umb://vendr-tax-class/a361b9768b2e46409f3209a68c10bcd1","DefaultOrderStatusUdi":"umb://vendr-order-status/b065bc595b844b11b1e6c71aef6d9c0e","ErrorOrderStatusUdi":"umb://vendr-order-status/b8d4736e563441f1a649347b828e434d","PricesIncludeTax":false,"CookieTimeout":"365.00:00:00","CartNumberTemplate":"CART-{0}","OrderNumberTemplate":"ORDER-{0}","ProductPropertyAliases":[],"ProductUniquenessPropertyAliases":[],"ShareStockFromStoreUdi":null,"GiftCardCodeLength":10,"GiftCardDaysValid":1095,"GiftCardCodeTemplate":null,"GiftCardPropertyAliases":["giftCardRecipientName","giftCardRecipientEmail","giftCardMessage"],"GiftCardActivationMethod":0,"GiftCardActivationOrderStatusUdi":null,"DefaultGiftCardEmailTemplateUdi":"umb://vendr-email-template/baaac162f6b74aa8b6cd54e05482b7e0","ConfirmationEmailTemplateUdi":"umb://vendr-email-template/e3347edc38594b12899363c765016ce2","ErrorEmailTemplateUdi":"umb://vendr-email-template/b4c9ecfe00e944a9b95fbf0b6c04a6ab","OrderEditorConfig":"/app_plugins/vendr/config/order.editor.config.js","AllowedUsers":["email1@domain1.com","email1@domain2.com","email2@domain2.com","email3@domain2.com"],"AllowedUserRoles":["admin","editor","customusergroup"</span>],"SortOrder":0,"Udi":"umb://vendr-store/18ced013ad6b4a01848275bff5924cf2","Dependencies":[{"Udi":"umb://vendr-country/a8fa6d7c1b384d3d9e1fe3790f3e79a8","Ordering":false,"Mode":0},{"Udi":"umb://vendr-currency/5bfe58a5d76a4dd4a315e2503fb41da2","Ordering":false,"Mode":0},{"Udi":"umb://vendr-email-template/b4c9ecfe00e944a9b95fbf0b6c04a6ab","Ordering":false,"Mode":0},{"Udi":"umb://vendr-email-template/baaac162f6b74aa8b6cd54e05482b7e0","Ordering":false,"Mode":0},{"Udi":"umb://vendr-email-template/e3347edc38594b12899363c765016ce2","Ordering":false,"Mode":0},{"Udi":"umb://vendr-order-status/b065bc595b844b11b1e6c71aef6d9c0e","Ordering":false,"Mode":0},{"Udi":"umb://vendr-order-status/b8d4736e563441f1a649347b828e434d","Ordering":false,"Mode":0},{"Udi":"umb://vendr-tax-class/a361b9768b2e46409f3209a68c10bcd1","Ordering":false,"Mode":0}],"Name":"StoreName","Alias":"storealias","__type":"Vendr.Deploy,Vendr.Deploy.Artifacts.StoreArtifact"}
Target checksum json: {"BaseCurrencyUdi":"umb://vendr-currency/5bfe58a5d76a4dd4a315e2503fb41da2","DefaultCountryUdi":"umb://vendr-country/a8fa6d7c1b384d3d9e1fe3790f3e79a8","DefaultTaxClassUdi":"umb://vendr-tax-class/a361b9768b2e46409f3209a68c10bcd1","DefaultOrderStatusUdi":"umb://vendr-order-status/b065bc595b844b11b1e6c71aef6d9c0e","ErrorOrderStatusUdi":"umb://vendr-order-status/b8d4736e563441f1a649347b828e434d","PricesIncludeTax":false,"CookieTimeout":"365.00:00:00","CartNumberTemplate":"CART-{0}","OrderNumberTemplate":"ORDER-{0}","ProductPropertyAliases":[],"ProductUniquenessPropertyAliases":[],"ShareStockFromStoreUdi":null,"GiftCardCodeLength":10,"GiftCardDaysValid":1095,"GiftCardCodeTemplate":null,"GiftCardPropertyAliases":["giftCardRecipientName","giftCardRecipientEmail","giftCardMessage"],"GiftCardActivationMethod":0,"GiftCardActivationOrderStatusUdi":null,"DefaultGiftCardEmailTemplateUdi":"umb://vendr-email-template/baaac162f6b74aa8b6cd54e05482b7e0","ConfirmationEmailTemplateUdi":"umb://vendr-email-template/e3347edc38594b12899363c765016ce2","ErrorEmailTemplateUdi":"umb://vendr-email-template/b4c9ecfe00e944a9b95fbf0b6c04a6ab","OrderEditorConfig":"/app_plugins/vendr/config/order.editor.config.js","AllowedUsers":["email1@domain1.com"],"AllowedUserRoles":["admin","editor"],"SortOrder":0,"Udi":"umb://vendr-store/18ced013ad6b4a01848275bff5924cf2","Dependencies":[{"Udi":"umb://vendr-country/a8fa6d7c1b384d3d9e1fe3790f3e79a8","Ordering":false,"Mode":0},{"Udi":"umb://vendr-currency/5bfe58a5d76a4dd4a315e2503fb41da2","Ordering":false,"Mode":0},{"Udi":"umb://vendr-email-template/b4c9ecfe00e944a9b95fbf0b6c04a6ab","Ordering":false,"Mode":0},{"Udi":"umb://vendr-email-template/baaac162f6b74aa8b6cd54e05482b7e0","Ordering":false,"Mode":0},{"Udi":"umb://vendr-email-template/e3347edc38594b12899363c765016ce2","Ordering":false,"Mode":0},{"Udi":"umb://vendr-order-status/b065bc595b844b11b1e6c71aef6d9c0e","Ordering":false,"Mode":0},{"Udi":"umb://vendr-order-status/b8d4736e563441f1a649347b828e434d","Ordering":false,"Mode":0},{"Udi":"umb://vendr-tax-class/a361b9768b2e46409f3209a68c10bcd1","Ordering":false,"Mode":0}],"Name":"StoreName","Alias":"storealias","__type":"Vendr.Deploy,Vendr.Deploy.Artifacts.StoreArtifact"}

@MichaelNielsenDK hmmm, yea, I'm not sure of the best approach here.

We've already removed users / user groups as a "dependency" for the same reason but have kept them as "soft" dependencies (ie, not explicitly declared to Umbraco Deploy) in order to allow them to be hooked up correctly if they do exist on the target environment.

I wonder if Umbraco Deploy needs some kind of concept to say "these can be present or not, but it doesn't matter" 🤔

Removing entirely is an option but it would mean that permissions wouldn't be restored at any point regardless of whether a user exists on the target environment or not.

Hmmm, actually, maybe I've got an incorrect match type somewhere that is an "exact" match when it should be an "exists" match.

Ok, I've updated all the "Value Connectors" which are responsible for transferring Vendr property editor values to performs an "exist" match to check the linked entity exists rather than a "match" check which makes sure target entities match.

If you want to test this, there will be a 0.2.2 build on the unstable feed shortly.

Hmm... Unfortunately I can't test it, as I get another issue, the one described here
#3

Different decimal values on shipping method prices
https://prnt.sc/12548t8

So I guess Umbraco hasn't fixed that yet.

Hmm, that's interesting as I have implemented the fix that Andy suggested as a work around for this which would suggest that isn't working 🤔

Actually @MichaelNielsenDK are both environments running on the same version of Vendr Deploy? Looks like I implemented Andy's fix in 0.2.1 so would potentially need both environments using that version.

Yes but I actually didn't update it 😅 I wanted to test it again, before updating.

But after updating, it seems to have fixed both issues.

Awesome 👍