Add an admin flag to user
This commit is contained in:
parent
f1ea7841a2
commit
4c9742af65
5 changed files with 32 additions and 14 deletions
|
|
@ -36,7 +36,7 @@ pub async fn edit_recipe(
|
|||
) -> Result<Response> {
|
||||
if let Some(user) = user {
|
||||
if let Some(recipe) = connection.get_recipe(recipe_id, false).await? {
|
||||
if recipe.user_id == user.id {
|
||||
if model::can_user_edit_recipe(&user, &recipe) {
|
||||
let recipes = Recipes {
|
||||
published: connection
|
||||
.get_all_published_recipe_titles(tr.current_lang_code(), Some(user.id))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue