diff --git a/lib/philomena/users/ability.ex b/lib/philomena/users/ability.ex index 2a3efbc5..a8cedb88 100644 --- a/lib/philomena/users/ability.ex +++ b/lib/philomena/users/ability.ex @@ -340,13 +340,9 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do do: true # Edit comments on images - def can?(%User{id: id}, action, %Comment{hidden_from_users: false, user_id: id} = comment) - when action in [:edit, :update] do - # comment must have been made no later than 15 minutes ago - time_ago = NaiveDateTime.utc_now() |> NaiveDateTime.add(-15 * 60) - - NaiveDateTime.diff(comment.created_at, time_ago) > 0 - end + def can?(%User{id: id}, action, %Comment{hidden_from_users: false, user_id: id}) + when action in [:edit, :update], + do: true # Edit metadata on images where that is allowed def can?(_user, :edit_metadata, %Image{hidden_from_users: false, tag_editing_allowed: true}),