Skip to content

Commit

Permalink
Allow users to edit project queries who have the edit permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-contreras committed Jul 5, 2024
1 parent e33e7b8 commit f2d98d1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def user_is_logged_in

def allowed_to_modify_private_query
return if model.public?
return if model.user == user
return if user.allowed_in_project_query?(:edit_project_query, model)

if model.user != user
errors.add :base, :can_only_be_modified_by_owner
end
errors.add :base, :can_only_be_modified_by_owner
end

def allowed_to_modify_public_query
Expand Down

0 comments on commit f2d98d1

Please sign in to comment.