announcement_policy.rb 311 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. class AnnouncementPolicy < ApplicationPolicy
  3. def index?
  4. role.can?(:manage_announcements)
  5. end
  6. def create?
  7. role.can?(:manage_announcements)
  8. end
  9. def update?
  10. role.can?(:manage_announcements)
  11. end
  12. def destroy?
  13. role.can?(:manage_announcements)
  14. end
  15. end