[StaffNotes] Restrict deletions to own notes or admins (#844)

This commit is contained in:
clragon 2025-01-22 15:00:54 +01:00 committed by GitHub
parent e649523400
commit f253ea940c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,7 +75,6 @@ class StaffNote < ApplicationRecord
def can_delete?(user)
return false unless user.is_staff?
return true if creator_id == user.id || user.is_admin?
user_id != user.id
user.id == creator_id || user.is_admin?
end
end