Skip to content

Commit

Permalink
Allow admins to create media mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hank committed Feb 25, 2022
1 parent fdffc04 commit 25b037a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def initialize(user)
can :create, Work
can :create, Entity
can :create, EntityNoticeRole
can :create, MediaMention

can :pdf_requests, :all
can :view_full_version, Notice
Expand Down
6 changes: 6 additions & 0 deletions spec/models/ability_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@
expect(subject.can? :edit, user).to be_falsey
expect(subject.can? :edit, role).to be_falsey
end

it "can create media mentions" do
%i[create read update].each do |action|
expect(subject.can? action, MediaMention.new).to be true
end
end
end

context "a super admin" do
Expand Down

0 comments on commit 25b037a

Please sign in to comment.