Class: Hyrax::RevokeEditJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/hyrax/revoke_edit_job.rb

Overview

Revokes the user's edit access on the provided FileSet

Instance Method Summary collapse

Instance Method Details

#perform(file_set_id, user_key) ⇒ Object

Parameters:

  • file_set_id (String)
    • the identifier of the object to revoke access from

  • user_key (String)
    • the user to remove


8
9
10
11
12
# File 'app/jobs/hyrax/revoke_edit_job.rb', line 8

def perform(file_set_id, user_key)
  file_set = ::FileSet.find(file_set_id)
  file_set.edit_users -= [user_key]
  file_set.save!
end