Create GitLab project and assign different roles (e.g., Developer, Maintainer) to users. Verify access permissions for each role by performing action

Create GitLab project and assign different roles (e.g., Developer, Maintainer) to users. Verify access permissions for each role by performing action

To create a GitLab project and assign different roles to users while verifying access permissions for each role, follow these steps:

Step 1: Create a GitLab Project

  1. Log in to GitLab: Go to your GitLab instance and log in.

  2. Create a New Project:

    • Click on the New project button (usually found on your dashboard or in the top-right corner).

    • Select Create blank project.

    • Fill in the project details (Project name, Description, Visibility level).

    • Click on Create project.

Step 2: Add Users and Assign Roles

  1. Navigate to Project Members:

    • Go to your project page.

    • On the left sidebar, click on Settings and then select Members.

  2. Add Users:

    • In the Invite member section, enter the usernames or email addresses of the users you want to add.

    • Assign roles from the dropdown menu:

      • Guest: Can view the project.

      • Reporter: Can view and comment on issues, merge requests, and pull requests.

      • Developer: Can push to branches and create merge requests.

      • Maintainer: Can manage project settings, including merging and pushing to protected branches.

      • Owner: Has full access to the project (only available for top-level groups).

  3. **Click the Invite button to add users with their assigned roles.

Step 3: Verify Access Permissions

To verify access permissions, ask each user to perform actions based on their role:

  1. Developer:

    • Push Changes: Have the Developer create a new branch, make changes, and push the branch to the repository.

        git checkout -b feature/developer-branch
        echo "Changes made by developer" > developer_file.txt
        git add developer_file.txt
        git commit -m "Developer changes"
        git push origin feature/developer-branch
      
    • Merge Requests: The Developer should be able to create a merge request for their changes.

  2. Maintainer:

    • Merge Changes: The Maintainer should review the merge request created by the Developer and merge it into the main branch.

    • Manage Project Settings: The Maintainer should be able to access project settings and modify them.

  3. Reporter:

    • View Issues and Merge Requests: The Reporter should be able to view issues and merge requests but not modify or merge them.
  4. Guest:

    • Limited Access: The Guest should only be able to view project details without making any changes.

Step 4: Testing Access

  • Have each user log in to GitLab and perform their designated actions.

  • Ensure that users can only perform actions allowed by their assigned roles.

Summary

You've created a GitLab project, assigned different roles to users, and verified access permissions for each role by performing actions like merging, pushing, and accessing project settings. If you have any questions or need further assistance, feel free to ask!