Skip to content

Improve mayEditStore() to fail faster

Johannes requested to merge Jo-improve-mayEditStore into master

What does this MR do?

Make mayEditStore() fail faster without db query if a user has not passed the store manager quiz in general. Pretty much adding a cached session check before the database query is executed. Prevents execution in every case where a person is not a store manager.

How confident are you it won't break things if deployed?

Very

Links to related issues

https://yunity.slack.com/archives/C74JC2V26/p1580138951036800 (#foodsharing-beta)

How to test

Steps a reviewer can take to verify that this MR does what it says it does e.g.

  1. Checkout branch locally
  2. Login as a store manager ("bieb")
  3. Navigate to a store where you are store manager of
  4. Check if you can still visit the store settings page

Screenshots

None - backend change

Checklist

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • joined #foodsharing-beta channel at https://slackin.yunity.org
  • added an entry to CHANGELOG.md (description, merge request link, username(s))
  • Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings
Edited by Alex

Merge request reports