Skip to content

Commit

Permalink
fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 27, 2020
1 parent 3589b31 commit e1e0f0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/concerns/authenticable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def not_allowed_by_doi_and_user(doi: nil, user: nil)
return false if doi.aasm_state == "findable"
return true if user.blank?
return false if %w(staff_admin staff_user).include?(user.role_id)
return false if %w(consortium_admin).include?(user.role_id) && user.provider_id.present? && user.provider_id == doi.client.consortium_id
return false if %w(consortium_admin).include?(user.role_id) && user.provider_id.present? && user.provider_id.upcase == doi.provider.consortium_id
return false if %w(provider_admin provider_user).include?(user.role_id) && user.provider_id.present? && user.provider_id == doi.provider_id
return false if %w(client_admin client_user user temporary).include?(user.role_id) && user.client_id.present? && user.client_id == doi.client_id
return true
Expand Down
2 changes: 1 addition & 1 deletion spec/concerns/authenticable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@

context "draft doi" do
let(:consortium) { create(:provider, symbol: "DC", role_name: "ROLE_CONSORTIUM") }
let(:provider) { create(:provider, symbol: "DATACITE", role_name: "ROLE_CONSORTIUM_ORGANIZATION") }
let(:provider) { create(:provider, symbol: "DATACITE", consortium: consortium, role_name: "ROLE_CONSORTIUM_ORGANIZATION") }
let(:client) { create(:client, provider: provider, symbol: "DATACITE.RPH") }
let(:doi) { create(:doi, client: client) }

Expand Down

0 comments on commit e1e0f0e

Please sign in to comment.