# Managing groups

## User group concept <a href="#group-concept" id="group-concept"></a>

To manage permissions more easily, users can be managed through groups. The following applies:

* Permissions can be set at both user and group levels.
* A user can belong to several groups within an organization.
* A user’s permissions are the sum of all the permissions granted to them individually plus all the permissions granted by the groups they are a member of.

{% hint style="info" %}
Depending on the authentication method used, automatic group synchronization may be used. For more information, see [#user-and-group-provisioning](https://docs.sonarsource.com/sonarqube-server/authentication/overview#user-and-group-provisioning "mention").
{% endhint %}

Two default built-in groups are used:

* The **sonar-users** group contains all authenticated users. You can edit the group’s permissions, but you cannot delete it or change its name or content.
* The **sonar-administrators** group contains the default system administrator (admin) that is created during SonarQube Server instance installation. You can manage this group as any other group.

{% hint style="warning" %}
For security reasons, it is highly recommended that the **sonar-administrators** group’s name be changed. If automatic group provisioning is used, this group may be used to gain unauthorized access.
{% endhint %}

## Creating a new user group <a href="#create-group" id="create-group"></a>

<figure><img src="https://2744305742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VWSqvZ4eaBLWvA6epdv%2Fuploads%2FnHjvARpz6URt21dkWxWL%2Fadmin-groups%20(1).png?alt=media&#x26;token=29d0c894-48b5-419d-8352-b07cc7db04f8" alt="Creating a new grop"><figcaption></figcaption></figure>

1. In the top navigation bar, go to **Administration > Security > Groups**. The **Groups** page opens with the list of existing user groups.
2. Select the **Create Group** button. The **Create Group** dialog opens.
3. Enter the group name and description.
4. Confirm with **Create**. The new group is added to the list.
5. In the **Members** column, select the list icon to add users to the group: see below.

## Adding/removing users to/from a group <a href="#add-remove-users" id="add-remove-users"></a>

You cannot add or remove users from a group if automatic group synchronization is used.

To add or remove users to/from a user group:

1. In **Administration > Security > Groups**, retrieve the group.
2. In the group’s **Members** column, select the icon. The **Users list** dialog opens.
3. Select the **All** option.
4. Select or unselect the check box to add or remove a user to or from the group.
5. Select the **Done** button.

## Changing the name or description of a group <a href="#change-name-or-description" id="change-name-or-description"></a>

1. In **Administration > Security > Groups**, retrieve the group.
2. In the group’s **Actions** column, select the menu icon.
3. In the menu, select the **Update details** command. The **Update Group** dialog opens.
4. Edit the group details and select the **Update** button.

## Deleting a user group <a href="#delete-group" id="delete-group"></a>

You can only delete a group if it does not result in the removal of all global System Administrators.

To delete a group:

1. In **Administration > Security > Groups**, retrieve the group.
2. In the group’s **Actions** column, select the menu icon.
3. In the menu, select the **Delete** command and confirm.
