Giter Club home page Giter Club logo

hydra-role-management's Introduction

hydra-role-management

Code: Gem Version Build Status Coverage Status

Docs: Contribution Guidelines Apache 2.0 License

Community Support: Samvera Community Slack

What is hydra-role-management?

An engine gem to provide a RDBMS backed list of roles and their associated user. This replaces the hydra default role mapper.

As of version 1.0, this gem only supports Rails 5.

Product Owner & Maintenance

hydra-role-management was a Core Component of the Samvera Community. Given a decline in available labor required for maintenance, this project no longer has a dedicated Product Owner. The documentation for what this means can be found here.

Product Owner

Vacant

Until a Product Owner has been identified, we ask that you please direct all requests for support, bug reports, and general questions to the #dev Channel on the Samvera Slack.

Help

The Samvera community is here to help. Please see our support guide.

Installing:

  • Add: gem 'hydra-role-management' to your Gemfile and then bundle install
  • rails generate roles
  • rake db:migrate
  • Add the following cancan abilities:
  # app/models/ability.rb
  if current_user.admin?
    can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role
  end

Testing:

  • Install a system javascript runtime or uncomment therubyracer in spec/support/Gemfile

  • Ensure that the testing app does not exist: bundle exec rake engine_cart:clean

  • Set Rails version you want to test against. For example:

    • export RAILS_VERSION=5.1.4
  • Ensure that the correct version of Rails is installed: bundle update

  • Build test app: bundle exec rake engine_cart:generate

  • And run tests: bundle exec rake ci

Releasing

  1. bundle install
  2. Increase the version number in lib/hydra/role_management/version.rb
  3. Increase the same version number in .github_changelog_generator
  4. Update CHANGELOG.md by running this command:
github_changelog_generator --user samvera --project hydra-role-management --token YOUR_GITHUB_TOKEN_HERE
  1. Commit these changes to the main branch

  2. Run rake release

Acknowledgments

This software has been developed by and is brought to you by the Samvera community. Learn more at the Samvera website.

Samvera Logo

hydra-role-management's People

Contributors

acurley avatar awead avatar bess avatar botimer avatar carolyncole avatar cjcolvar avatar dunn avatar elrayle avatar jcoyne avatar jeremyf avatar jrgriffiniii avatar mbklein avatar mjgiarlo avatar mkorcy avatar randalldfloyd avatar rotated8 avatar tpendragon avatar val99erie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hydra-role-management's Issues

Add support for Ruby 2.7.z releases

Ruby 2.7.0 was released on 12/25/2019, and in accordance with the charter of the current phase of the Component Maintenance Working Group, the CircleCI configuration for this should be updated.

Add Circle CI step that fails if branch name is master

Descriptive summary

This repository’s default branch has already been renamed to main using GitHub’s renaming tool. In order to preserve automatic redirection of links that reference the old branch name master to the new default main branch, a branch with the old name should not be recreated.

CircleCI can be used to prevent the recreation of the old default branch name by preventing PRs with a branch named master from being merged by causing a test failure during continuous integration.

Rationale

Git's default "master" branch derives from "master/slave" jargon which perpetuates systemic racist language and systems (see email Replacing "master" reference in git branch names). To uphold our Code of Conduct, we must move away from the term "master" in our technical language (as well as words like blacklist or whitelist).

Expected behavior

If a PR is submitted with a branch named master, the continuous integration tests should fail.

Actual behavior

If a PR is submitted with a branch named master, the continuous integration tests will not fail because of the branch name.

Related work

Background on the renaming effort is available in the working group notes.

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

Upgrade Blacklight

All versions of Rails are affected by a remote code execution bug, CVE-2022-32224, affecting serialized YAML. There are no workarounds- Rails expects everyone to upgrade to safe versions: 7.0.3.1, 6.1.6.1, 6.0.5.1, or 5.2.8.1. These new versions of Rails appear to have caught the community off guard, and frequently require other code changes to successfully upgrade.

hydra-role-management does not call serialize itself, but Blacklight does. Blacklight version 7.28.0 supports the Rails versions above.

Community feedback to the Rails team has led to new tickets and pull requests to make this upgrade easier, and the consensus from the Hyrax Working Group and Tech calls this week is to wait a little while for the dust to settle before implementing this upgrade. The current versions of Ruby on Rails and Blacklight may not be the best to target for this work.

Regression: Users must exist before they can be added to roles

The default role mapper allowed a username to be added to a role before a user has registered.

We use this for people wanting access to our test server. They email us requesting access, we add them to a role, and send them an email with instructions for how to create an account through IU's CAS.

Another use case would be students or TAs that you want added to a role before a term starts and not have to negotiate with each one to add them to a role after they have registered with the system.

The existing behavior could be easily restored by creating a user when they are added to a group and this works in our system which uses devise+omniauth but wouldn't with default devise. Is there a better way to provide for this use case?

Add support for Rails 6.0.z releases

Rails version 6.0.0 was released on 08/16/2019, and in accordance with the charter of the current phase of the Component Maintenance Working Group, the CircleCI configuration for this should be updated.

Email as User id

User ids are integers, however, when deleting users from roles, an email string is used:

http://localhost:3000/roles/3/users/awead@aic-dot-org

As opposed to the integer id of the user:

http://localhost:3000/roles/3/users/1

Is there a Devise configuration I'm missing?

This gem is incompatible with Rails 5.1.2 migrations

Thanks so much for this gem! However, I run into troubles in Rails 5, because the migrations are only suitable for Rails 4. For example, if in a Rails 5.1.2 app, I run the following commands:

rails generate roles
rake db:migrate

I get the error:

Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for

Decouple from hydra-head

There doesn't seem to be any reason to have the hydra-head dependency. Is there any reason we can't remove it?

Json 1.8 dependency is incompatible with bundler 2.x

Bundler 2.x seems to come with json 2.x installed by default, which means that when I take an application that uses hydra-role-management and try to upgrade it to use the latest bundler, I get an error like this:

/home/bess/.rvm/gems/ruby-2.6.3@cypripedium/gems/bundler-2.0.2/lib/bundler/runtime.rb:319:in `check_for_activated_spec!': You have already activated json 2.1.0, but your Gemfile requires json 1.8.6. Since json is a default gem, you can either remove your dependency on it 
or try updating to a newer version of bundler that supports json as a default gem. (Gem::LoadError)    

If I download the hydra-role-management gem, I can run the test suite locally against json 2.x.

roles generator messes up routes file

I had this line in my routes file:

devise_for :users, controllers: { sessions: :sessions, registrations: :registrations}

When I ran "rails generate roles", it inserted the role management line in the middle of the devise line, so my routes file looked like this:

devise_for :users
mount Hydra::RoleManagement::Engine => '/'
, controllers: { sessions: :sessions, registrations: :registrations}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.