Skip to content

LIBTD-1340: Migrate Role Management + Collection functionality to Hyrax 2.1.0

Janice J Kim requested to merge LIBTD-1340 into LIBTD-1334

For this PR, I basically added the hydra-role-management gem and migrated related rake tasks. I also added one additional rake task for creating a default CollectionType.

To try it out:

  • Run InstallScripts using project_name: 'compel' and project_git_identifier: 'LIBTD-1340'
  • Bring up the application and sign up for an account
  • Add that account's email to admin_list.txt
  • Run the following to add Hydra management roles and upgrade your user to have admin privileges (similar to the previous binary_arts project)
  $ bin/rake compel:add_roles
  $ bin/rake compel:upgrade_users
  • Run the following to create the default COMPEL collection type
  railsapps@compel:~/compel$ bin/rake compel:create_default_collection_type
  • Login again and access your dashboard
  • Click on Settings > Collection Types. You should see 'Collection' as one of the 'Current Collection Types'
  • Click on Collections. You should also be able to see the button "New Collection" and be able to create a simple collection without errors.

Additional notes:

  • There are errors when attempting to actually show/view a collection, but I expect these errors to be resolved once Work types have been added (see LIBTD-1335).
  • Also, I'm not sure why it's happening, but I'm having to run unset XDG_RUNTIME_DIR to get past a spring error when I run commands like bin/rails or bin/rake:
$ bin/rake compel:upgrade_users
/usr/lib/ruby/2.3.0/fileutils.rb:254:in `mkdir': Permission denied @ dir_s_mkdir - /run/user/1000/spring-1001 (Errno::EACCES)
                                        from /usr/lib/ruby/2.3.0/fileutils.rb:254:in `fu_mkdir'
                                        from /usr/lib/ruby/2.3.0/fileutils.rb:228:in `block (2 levels) in mkdir_p'
                                        from /usr/lib/ruby/2.3.0/fileutils.rb:226:in `reverse_each'
                                        from /usr/lib/ruby/2.3.0/fileutils.rb:226:in `block in mkdir_p'
                                        from /usr/lib/ruby/2.3.0/fileutils.rb:211:in `each'
                                        from /usr/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/env.rb:40:in `tmp_path'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/env.rb:49:in `socket_path'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/env.rb:53:in `socket_name'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/run.rb:26:in `connect'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/run.rb:31:in `call'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
                                        from /var/local/hydra/compel/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
                                        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
                                        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
                                        from /var/local/hydra/compel/bin/spring:15:in `<top (required)>'
                                        from bin/rake:3:in `load'
                                        from bin/rake:3:in `<main>'

Merge request reports