Skip to content

Sync Member Roles when syncing members via Group Sync

Alex Buijs requested to merge sync-member-roles-via-group-sync into master

What does this MR do and why?

When a Member Role exists on a SAML Group Link, save the Member Role when syncing members via SAML Group Sync.

Issue: #417201 (closed)

How to set up and validate locally

  1. Enable Group SAML

    gdk config set omniauth.group_saml.enabled true && gdk reconfigure && gdk restart rails-web
  2. Enable the feature flag in the console:

    Feature.enable(:custom_roles_for_saml_group_links)
  3. Create a group with Ultimate license

  4. Go to http://localhost:3000/groups/${group_id}/-/settings/roles_and_permissions and create a custom role

  5. Go to http://localhost:3000/groups/${group_id}/-/saml and enable SAML authentication by adding a bogus identity provider:

    Screenshot_2023-12-07_at_17.11.02

  6. Go to http://localhost:3000/groups/${new_group}/-/saml_group_links, fill in a name and select the custom role

  7. In the console, simulate a group sync with a random existing user:

    GroupSamlGroupSyncWorker.new.perform(${user_id},${group_id}, [${saml_group_link_id}])
    => {:added=>1, :updated=>0, :removed=>0}
  8. Check that the user was added as a direct member to the group with the member role

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alex Buijs

Merge request reports

Loading