Skip to content

Commit

Permalink
permissions for password reset flow. datacite/datacite#832
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Aug 24, 2019
1 parent cb57cc1 commit 2902319
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ def initialize(user)
can [:read], Activity do |activity|
activity.doi.findable?
end
elsif user.role_id == "temporary"
can [:read, :update], Provider, :symbol => user.provider_id.upcase if user.provider_id.present?
can [:read, :update], Client, :symbol => user.client_id.upcase if user.client_id.present?
can [:read], Doi, :client_id => user.client_id if user.client_id.present?
can [:read, :get_url], Doi do |doi|
doi.findable?
end
can [:read], User, :id => user.id
can [:read], Phrase
can [:read], Researcher
can [:read], Activity do |activity|
activity.doi.findable?
end
elsif user.role_id == "anonymous"
can [:read, :get_url], Doi do |doi|
doi.findable?
Expand Down

0 comments on commit 2902319

Please sign in to comment.