Skip to content

Commit

Permalink
remove Hyrax::RoleManagement from .koppie (#6272)
Browse files Browse the repository at this point in the history
including this makes the whole application very different from `.dassie`, in a
way that complicates the test suite substantially.
  • Loading branch information
tamsin johnson authored Aug 30, 2023
1 parent c3940d4 commit eb79277
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 35 deletions.
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: '[email protected]') 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:
- [email protected]
archivist:
- [email protected]

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

0 comments on commit eb79277

Please sign in to comment.