Refactor recipe editing logic to use User's method for permission check and update template accordingly
This commit is contained in:
parent
be6905cc3b
commit
c296689c6b
4 changed files with 9 additions and 7 deletions
|
|
@ -104,7 +104,7 @@ pub async fn dev_panel(
|
|||
}
|
||||
}
|
||||
|
||||
///// DEV_PANEL /////
|
||||
///// LOGS /////
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct LogFile {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ pub async fn edit(
|
|||
) -> Result<Response> {
|
||||
if let Some(ref user) = context.user {
|
||||
if let Some(recipe) = connection.get_recipe(recipe_id, false).await? {
|
||||
if model::can_user_edit_recipe(user, &recipe) {
|
||||
if user.can_edit_recipe(&recipe) {
|
||||
Ok(Html(
|
||||
RecipeEditTemplate {
|
||||
recipes: Recipes::new(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue