Skip to content

Update assigned custom role to a group invited to a project

What does this MR do and why?

This MR implements displaying and updating the custom role assigned to a group that was invited to a project.

References

This MR implements:

  1. Update frontend to display custom role assigned... (#506678 - closed); and
  2. Update frontend to allow updating assigned cust... (#506679 - closed)

Parts of Assign custom role when sharing a project to a ... (#468329).

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Display assigned custom role to a group invited to a project

Before After
Screenshot_2024-12-02_at_2.43.45_PM Screenshot_2024-12-02_at_2.42.32_PM

Update assigned custom role to a group invited to a project

Screen_Recording_2024-12-02_at_2.49.51_PM

How to set up and validate locally

  1. Start GDK with GITLAB_SIMULATE_SAAS=1

    $ export GITLAB_SIMULATE_SAAS=1
    $ gdk start
  2. Enable required feature flags

    $ rails c
    > Feature.enable(:assign_custom_roles_to_group_links_saas)
    > Feature.enable(:assign_custom_roles_to_project_links_saas)
  3. Login with root user and generate a PAT with api scope

  4. Visit a group and create two custom roles (e.g. http://localhost:9393/flightjs/)

  5. With a project under the group in 3 (e.g. http://localhost:9393/flightjs/Flight/), send an API request to share the project to another group (e.g. http://localhost:9393/gitlab-org) with the new custom role

    $ curl --request POST --header "Content-Type: application/json" --data '{"group_access": 10, "group_id": <share_with_group_id>, "member_role_id": <custom_role_id>}' --header "PRIVATE-TOKEN: <root_user_access_token>" "localhost:9393/api/v4/projects/<project_id>/share"

    Note: group_access value should be the same as the base access_level of the custom role you created (e.g. if you selected Guest, group_access should be 10)

  6. Visit the Project members page of the shared group

    Like this Screenshot_2024-12-02_at_2.42.32_PM
  7. Verify that the custom role assigned to the group can be updated

    Like this Screen_Recording_2024-12-02_at_2.49.51_PM
Edited by Eugie Limpin

Merge request reports

Loading