-
-
Notifications
You must be signed in to change notification settings - Fork 854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Additional Household Permissions #4158
feat: Additional Household Permissions #4158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was alot, but luckily most of it was pretty self-explanatory. Just a few mini-comments. Did not find anything major. Will do a bit more real-world testing now but i think we are looking good 👍
frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageHeader.vue
Outdated
Show resolved
Hide resolved
…ecipePageHeader.vue Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
…nal-household-permissions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 🚀
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
(REQUIRED)
This PR adds two household-related permissions:
Lock Recipe Edits From Other Households
This flag lets households decide if other households can only view their recipes, or if they can edit them. With this unflagged, any user from any household in the group can edit their recipes.
When set, it behaves like it was implemented in #4089 (users from other households can't edit). When unset, edits (including deletes) are allowed (this is a new feature from this PR).
Can Manage Household
This flag allows users to manage household settings (such as the new lock recipe edits flag). Previously this was tied to the generic
Can Manage
permission, but it makes sense to want users to be able to manage their own households, but not necessarily manage the group.Both flags are added to their respective settings pages:




I also merged the two household settings pages; one was using a component, and one was just baked into the page, so I replaced the page one with the component. The component was missing all of the help text, so I re-wrote it to support the help text.
For reference, it currently looks like this:

And now it looks like this:

Which issue(s) this PR fixes:
(REQUIRED)
Closes #4082
Special notes for your reviewer:
(fill-in or delete this section)
I added a new route to fetch a household by id, since we need to check permissions of the recipe's household (which isn't always your household anymore). I also fixed the inconsistency where getting a recipe by id works, but updating/deleting only works by slug. All recipe routes should accept either slugs or ids now.
Testing
(fill-in or delete this section)
frontend and backend tests