Rights do not need to be checked when adding or removing scheduled recipe

This commit is contained in:
Greg Burri 2025-06-06 22:54:43 +02:00
parent 40f14893b6
commit 746dbb3f1b

View file

@ -14,8 +14,6 @@ use crate::{
translation::Sentence,
};
use super::rights::*;
#[debug_handler]
pub async fn get_scheduled_recipes(
State(connection): State<db::Connection>,
@ -53,7 +51,6 @@ pub async fn add_scheduled_recipe(
Extension(context): Extension<Context>,
ExtractRon(ron): ExtractRon<common::web_api::ScheduleRecipe>,
) -> Result<Response> {
check_user_rights_recipe(&connection, &context.user, ron.recipe_id).await?;
if let Some(user) = context.user {
connection
.add_scheduled_recipe(
@ -79,7 +76,6 @@ pub async fn rm_scheduled_recipe(
Extension(context): Extension<Context>,
ExtractRon(ron): ExtractRon<common::web_api::RemoveScheduledRecipe>,
) -> Result<impl IntoResponse> {
check_user_rights_recipe(&connection, &context.user, ron.recipe_id).await?;
if let Some(user) = context.user {
connection
.rm_scheduled_recipe(