Sha256: 5e589f967dbe8902ae33d2c8332adadb17d5398b5677243ac96a26488af1d867

Contents?: true

Size: 930 Bytes

Versions: 9

Compression:

Stored size: 930 Bytes

Contents

module Hyrax
  module Admin
    class PermissionTemplateAccessesController < ApplicationController
      load_and_authorize_resource class: 'Hyrax::PermissionTemplateAccess'

      def destroy
        @permission_template_access.destroy
        update_admin_set if @permission_template_access.manage?

        redirect_to hyrax.edit_admin_admin_set_path(admin_set_id,
                                                    anchor: 'participants'),
                    notice: translate('participants', scope: 'hyrax.admin.admin_sets.form.permission_update_notices')
      end

      private

        # @return [String] the identifier for the AdminSet for the currently loaded resource
        def admin_set_id
          @admin_set_id ||= @permission_template_access.permission_template.admin_set_id
        end

        def update_admin_set
          AdminSet.find(admin_set_id).update_access_controls!
        end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hyrax-1.1.1 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.1.0 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.0.5 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.0.4 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.0.3 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.0.2 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.0.1 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.0.0.rc2 app/controllers/hyrax/admin/permission_template_accesses_controller.rb
hyrax-1.0.0.rc1 app/controllers/hyrax/admin/permission_template_accesses_controller.rb