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

Groups with Roles feature #1859

Merged
merged 70 commits into from
Feb 3, 2023
Merged

Groups with Roles feature #1859

merged 70 commits into from
Feb 3, 2023

Conversation

bkiahstroud
Copy link
Collaborator

Introduce ability to add roles to groups. Group members inherit the
permissions attached to the group's roles.

Notable changes:

  • Several new Roles for Work, Collection, and User management
  • Role permission integration with Hyrax permission logic (Sipity,
    access controls, CanCan, etc.)
  • Hyku::Group replaced with already existing Hyrax::Group
  • Easily assign roles to individual users
  • Extended UI
  • Both pre-configured and customizable groups
  • Scripts to migrate existing Hyku applications
  • More

This work is a joint contribution of PALNI and PALCI's Hyku for Consortia project.

Introduce ability to add roles to groups. Group members inherit the
permissions attached to the group's roles.

Notable changes:
- Several new Roles for Work, Collection, and User management
- Role permission integration with Hyrax permission logic (Sipity,
  access controls, CanCan, etc.)
- Hyku::Group replaced with already existing Hyrax::Group
- Easily assign roles to individual users
- Extended UI
- Both pre-configured and customizable groups
- Scripts to migrate existing Hyku applications
- More

This work is a joint contribution of PALNI and PALCI's Hyku for Consortia project.
bkiahstroud and others added 14 commits December 20, 2022 18:24
has_model_ssim is required to be in the permissions request handler for the Groups with Roles feature to work properly. Without it, CanCan rules for Strings won't work.

Found when running the spec/abilities/collection_ability_spec.rb
… set by default

Found when running spec/features/admin_set_form_participants_tab_spec.rb
* run rubocop autocorrect

* fix metrics/linelength line is too long

* linelength, rubocop.yml, rails logger & time fixes

* linelength, rubocop.yml fixes

* Update app/services/roles_service.rb

breaks conditional for if...end statement

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>

* Update app/services/roles_service.rb

make a more ideal breaking point

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>

* Update app/controllers/admin/group_roles_controller.rb

change to a more ideal breaking point

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>

* fix metric/linelength cop

* fix metrics/linelength cop

* fix metrlics/linelength cop

* fix metric/linelength cop

* fix metrics/linelength offenses

* more rubocop fixes in app/models dir

* rubocop RSpec/LetSetup fixes

* rubocop RSpec/RepeatedDescription fixes

* rubocop RSpec/ExampleLength fixes

* rubocop RSpec/ScatteredSetup and RSpec/ExpectInHook fixes

* misc rubocop fixes

* update rubocop TODO file

* the last melon

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>
Co-authored-by: Benjamin Kiah Stroud <bkiahstroud@users.noreply.github.com>
Introduce ability to add roles to groups. Group members inherit the
permissions attached to the group's roles.

Notable changes:
- Several new Roles for Work, Collection, and User management
- Role permission integration with Hyrax permission logic (Sipity,
  access controls, CanCan, etc.)
- Hyku::Group replaced with already existing Hyrax::Group
- Easily assign roles to individual users
- Extended UI
- Both pre-configured and customizable groups
- Scripts to migrate existing Hyku applications
- More

This work is a joint contribution of PALNI and PALCI's Hyku for Consortia project.
has_model_ssim is required to be in the permissions request handler for the Groups with Roles feature to work properly. Without it, CanCan rules for Strings won't work.

Found when running the spec/abilities/collection_ability_spec.rb
… set by default

Found when running spec/features/admin_set_form_participants_tab_spec.rb
* run rubocop autocorrect

* fix metrics/linelength line is too long

* linelength, rubocop.yml, rails logger & time fixes

* linelength, rubocop.yml fixes

* Update app/services/roles_service.rb

breaks conditional for if...end statement

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>

* Update app/services/roles_service.rb

make a more ideal breaking point

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>

* Update app/controllers/admin/group_roles_controller.rb

change to a more ideal breaking point

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>

* fix metric/linelength cop

* fix metrics/linelength cop

* fix metrlics/linelength cop

* fix metric/linelength cop

* fix metrics/linelength offenses

* more rubocop fixes in app/models dir

* rubocop RSpec/LetSetup fixes

* rubocop RSpec/RepeatedDescription fixes

* rubocop RSpec/ExampleLength fixes

* rubocop RSpec/ScatteredSetup and RSpec/ExpectInHook fixes

* misc rubocop fixes

* update rubocop TODO file

* the last melon

Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>
Co-authored-by: Benjamin Kiah Stroud <bkiahstroud@users.noreply.github.com>
labradford and others added 10 commits January 4, 2023 11:03
The MakeSureUsersHaveGroups migration was throwing errors when running on an existing Hyku application that already had data. Instead of making data changes in a migration (which is not best practice), replace it with a rake task that can be run when upgrading an existing app.

Also, rework User#add_default_group_memberships! to not:
1) run every time a user is saved
2) add users with the admin role to the admin group
Neither of those things are necessary. The new rake task takes care of updating existing admin users, and new tenants will always add admins to their admin group because of CreateAccount#add_initial_users
Fixes a bug where the Depositors and Editors groups were not being granted their Workflow Roles, thus causing lots of issues (e.g. editors not being able to review pending works)
app/controllers/admin/group_roles_controller.rb Outdated Show resolved Hide resolved
app/forms/hyrax/forms/collection_form.rb Outdated Show resolved Hide resolved
app/services/roles_service.rb Outdated Show resolved Hide resolved
app/views/hyrax/batch_edits/_delete_selected.html.erb Outdated Show resolved Hide resolved
app/views/hyrax/dashboard/collections/_form_share.html.erb Outdated Show resolved Hide resolved
bkiahstroud and others added 3 commits January 25, 2023 15:11
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: Steven McFarlane <steven@scientist.com>
@bkiahstroud bkiahstroud added the major-ver for release notes label Feb 2, 2023
@bkiahstroud bkiahstroud merged commit ac8f314 into main Feb 3, 2023
@bkiahstroud bkiahstroud deleted the groups-with-roles-feature branch February 3, 2023 18:56
@jeremyf jeremyf restored the groups-with-roles-feature branch December 22, 2023 13:45
@jeremyf jeremyf deleted the groups-with-roles-feature branch December 22, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-ver for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants