Skip to content

Commit

Permalink
Allow approvers to read and edit Etds and FileSets
Browse files Browse the repository at this point in the history
This ensures approvers can read (download) and edit Works and FileSets. Since
there's not an explicit "approving" group that we can use to set ACLs for these
works, we need to set the `can` permissions explictly. Whenever
`can_review_submissions?` is `true`, we let users read and edit a work, as well
as forcing `test_download` to `true`.

Connected to #1206, #1216.
  • Loading branch information
Tom Johnson committed Aug 3, 2018
1 parent b326772 commit ac39e3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ class Ability

# Define any customized permissions here.
def custom_permissions
can [:read, :edit], String if can_review_submissions?
return unless admin?
can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role
can [:destroy], ActiveFedora::Base
can [:read], Schools::School
end

def test_download(id)
super || can_review_submissions?
end

def ipe_permissions
can :create, InProgressEtd if registered_user?
can :update, InProgressEtd, user_ppid: current_user.ppid
Expand Down

0 comments on commit ac39e3f

Please sign in to comment.