Sha256: 6f5f84fd5a50bf40a6146af5d46f685b22bbf2184b8b45ff6965d9396f6ba4e6
Contents?: true
Size: 686 Bytes
Versions: 25
Compression:
Stored size: 686 Bytes
Contents
# frozen_string_literal: true module Hyrax # Grants the user's edit access on the provided FileSet class GrantEditJob < ApplicationJob include PermissionJobBehavior # @param file_set_id [String] the identifier of the object to grant access to # @param user_key [String] the user to add # @param use_valkyrie [Boolean] whether to use valkyrie support def perform(file_set_id, user_key, use_valkyrie: Hyrax.config.use_valkyrie?) if use_valkyrie acl(file_set_id).grant(:edit).to(user(user_key)).save else file_set = ::FileSet.find(file_set_id) file_set.edit_users += [user_key] file_set.save! end end end end
Version data entries
25 entries across 25 versions & 1 rubygems