Enable moderation abilities for Budget::Investment model

This commit is contained in:
Angel Perez
2018-06-13 13:41:21 -04:00
parent 4737664f6e
commit bcb0b9fbfa
3 changed files with 18 additions and 0 deletions

View File

@@ -17,6 +17,9 @@ module Abilities
can :restore, Legislation::Proposal
cannot :restore, Legislation::Proposal, hidden_at: nil
can :restore, Budget::Investment
cannot :restore, Budget::Investment, hidden_at: nil
can :restore, User
cannot :restore, User, hidden_at: nil
@@ -32,6 +35,9 @@ module Abilities
can :confirm_hide, Legislation::Proposal
cannot :confirm_hide, Legislation::Proposal, hidden_at: nil
can :confirm_hide, Budget::Investment
cannot :confirm_hide, Budget::Investment, hidden_at: nil
can :confirm_hide, User
cannot :confirm_hide, User, hidden_at: nil

View File

@@ -46,6 +46,9 @@ module Abilities
can [:flag, :unflag], Legislation::Proposal
cannot [:flag, :unflag], Legislation::Proposal, author_id: user.id
can [:flag, :unflag], Budget::Investment
cannot [:flag, :unflag], Budget::Investment, author_id: user.id
can [:create, :destroy], Follow
can [:destroy], Document, documentable: { author_id: user.id }

View File

@@ -63,6 +63,15 @@ module Abilities
cannot :moderate, ProposalNotification, author_id: user.id
can :index, ProposalNotification
can :hide, Budget::Investment, hidden_at: nil
cannot :hide, Budget::Investment, author_id: user.id
can :ignore_flag, Budget::Investment, ignored_flag_at: nil, hidden_at: nil
cannot :ignore_flag, Budget::Investment, author_id: user.id
can :moderate, Budget::Investment
cannot :moderate, Budget::Investment, author_id: user.id
end
end
end