Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove Hyrax::RoleManagement from .koppie #6272

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .koppie/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gem 'coffee-rails', '~> 4.2'
gem 'dalli'
gem 'devise', '4.8.0'
gem 'devise-guests', '0.8.1'
gem 'hydra-role-management'
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
Expand Down
6 changes: 1 addition & 5 deletions .koppie/app/models/ability.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
class Ability
include Hydra::Ability

include Hyrax::Ability
self.ability_logic += [:everyone_can_create_curation_concerns]

# Define any customized permissions here.
def custom_permissions
if current_user.admin?
can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role
end

# Limits deleting objects to a the admin user
#
# if current_user.admin?
Expand Down
2 changes: 0 additions & 2 deletions .koppie/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
class User < ApplicationRecord
# Connects this user object to Hydra behaviors.
include Hydra::User
# Connects this user object to Role-management behaviors.
include Hydra::RoleManagement::UserRoles

# Connects this user object to Hyrax behaviors.
include Hyrax::User
Expand Down
28 changes: 3 additions & 25 deletions .koppie/config/role_map.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
# nurax-pg uses Hydra::RoleManagement for user and role definition. The following
# examples show how to perform common setup actions.
#
# @see https://github.com/samvera/hydra-role-management
#
# Create admin role
#
# admin_role = Role.find_or_create_by(name: 'admin')
#
# Create a user
#
# admin_user = User.find_or_create_by(email: 'user@example.com') do |user|
# user.password = 'change_me'
# user.password_confirmation = 'change_me'
# user.confirmed_at = DateTime.now
# end
# admin_user.roles << admin_role unless admin_user.roles.include?(admin_role)
# admin_user.save!(validate: false)
#
# You can create non-admin roles and assign users to those roles using a similar pattern.
#
# The following roles might be used for testing, so they remain here. They will not
# be available for use when logged in through the browser.
#
development:
admin:
- admin@example.com
archivist:
- archivist1@example.com

Expand All @@ -45,4 +23,4 @@ test:

production:
admin:
- systems@curationexperts.com
- admin@example.com
3 changes: 1 addition & 2 deletions .koppie/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
mount BrowseEverything::Engine => '/browse'

mount Blacklight::Engine => '/'

concern :searchable, Blacklight::Routes::Searchable.new

resource :catalog, only: [:index], as: 'catalog', path: '/catalog', controller: 'catalog' do
concerns :searchable
end
devise_for :users
mount Hydra::RoleManagement::Engine => '/'
mount Sidekiq::Web => '/sidekiq'
mount Qa::Engine => '/authorities'
mount Hyrax::Engine, at: '/'
Expand Down