What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hey! I found this piece of code and i am wondering whats the reason for setting the permissions to n
Hey!
I found this piece of code and i am wondering whats the reason for setting the permissions to null and then load a new customer transfer to get the permissions again.
I did some simple tests and the returned permissions are still equal:
Can anyone tell me why this was done? With many permissions it becomes quite slow.
Comments
-
As per our development, when there were permissions already in the transfer they got duplicated. Also when you remove permissons they remained in transfer.
0 -
Hey, thanks for your answer, but i do not understand it.
This code runs while adding an item to the (persistent) cart. Permissions should not change while adding items to the cart. So my questions are:
1. why is it neccessary to expand theresponseQuoteTransfer
with permissions again?
2. why is it neccessary to set the permissions to null, call the customer facade (and let run further expanders...) to get the same permissions again?0 -
For each action with a cart, we update the list of carts available to the customer in the session, including the shared carts. There will be no access to the carts without updating the permissions.
0 -
Ok thanks a lot!
0 -
@UPPB2H525 In general, the idea is that Zed always loads the latest state from the database, it won’t thrust to what Yves “thinks” is actual. Exactly because “Permissions *should* not change” although they might - someone decided to change them, while the session of the current customer might also be quite old.
0 -
However, you can decide for your project that that’s rather an edge case (change of the permissions) and performance here is more important and override the logic, I would totally go for it if that brings a good improvement.
0 -
Hey @UKJSE6T47! Thanks for this information, sounds good and will check side impacts in our project!
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random