online_notifications_controller_policy.rb 396 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Controllers::OnlineNotificationsControllerPolicy < Controllers::ApplicationControllerPolicy
  3. def show?
  4. own?
  5. end
  6. def update?
  7. own?
  8. end
  9. def destroy?
  10. own?
  11. end
  12. private
  13. def own?
  14. notification = OnlineNotification.find(record.params[:id])
  15. notification.user_id == user.id
  16. end
  17. end