Skip to content

Commit

Permalink
Add invited users to the registered group
Browse files Browse the repository at this point in the history
Fixes a bug where users who were invited with no roles would not
show up in the users list at all
  • Loading branch information
bkiahstroud authored and jeremyf committed Oct 16, 2023
1 parent ad8444e commit db098e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/hyku/invitations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def create
authorize! :grant_admin_role, User if params[:user][:role] == ::RolesService::ADMIN_ROLE
self.resource = User.find_by(email: params[:user][:email]) || invite_resource

resource.add_default_group_membership!
resource.add_role(params[:user][:role], Site.instance) if params[:user][:role].present?

yield resource if block_given?
Expand Down

0 comments on commit db098e1

Please sign in to comment.