======
Groups
======

Creating groups allows you to assign members of your organization to a specific set of channels you've created within Package Security Manager. These channel sets are private and only accessible to authenticated users who are assigned to the groups that contain them.

It is also important to understand that any permissions that can be granted to an individual by assigning them a role can also be granted to multiple people by assigning the role to a group. This is useful when utilizing a federated user identity server (such as LDAP/AD). For more information about group permissions, see :ref:`Group roles <group_roles>`.

Anaconda utilizes Keycloak to manage groups. However, any action that is taken in Package Security Manager will also be applied in Keycloak, meaning you can perform most group management functions directly in Package Security Manager UI. Keep in mind, there are exceptions to this, and some tasks must be performed within the Keycloak UI.

Viewing your groups
===================

To view your groups at any time, select |user-groups| **Groups** from the left-hand navigation. Select a group from the list to view its associated channels and members. 

.. thumbnail:: ../img/as_view_group.png
    :align: center

Groups of users imported from external directory servers (such as LDAP/AD) also appear in this list, if the servers are synced. 

Creating a group
================

To create a new group, complete the following steps:

#. Log in to Package Security Manager.
#. Select |user-groups| **Groups** from the left-hand navigation and click |circle-plus| **Create Group**.
#. Enter a unique name and provide a brief description for your group, then click **Create**. 

.. _add_group_member:

Adding members to a group
=========================

To add members to a group, complete the following steps:

#. Log in to Package Security Manager. 
#. Select |user-groups| **Groups** from the left-hand navigation.
#. Select your group. 
#. Open the |gear| **Manage** dropdown menu and select *Add Members*.
#. Enter a username in the search field to find a member, then click on the user to add them to the group. Repeat this process until all members have been added to the group, then click **Save**. 
#. Assign permission levels for each member you've added to the group, then click **Save**. 

Removing members from a group
=============================

To remove members from a group, complete the following steps:

#. Log in to Package Security Manager. 
#. Select |user-groups| **Groups** from the left-hand navigation.
#. Select your group. 
#. Click **Remove** |trash| beside the username you want removed from the group.
#. Click **Remove** to confirm that you want to remove the member from the group. 

.. tip::

    You can remove multiple members at once by selecting the checkboxes for all users you want removed from the group and clicking |trash| **Remove # members(s)** at the top of the page.

Adding channels to a group
==========================

To add channels to a group, complete the following steps:

#. Log in to Package Security Manager. 
#. Select |user-groups| **Groups** from the left-hand navigation.
#. Select your group.
#. Open the |gear| **Manage** dropdown menu and select *Assign to Channel*.
#. Open the dropdown menu and select a channel to assign to the group. 
#. Set the permission level for group members to have within the channel, then click **Save**.

.. note:: 
    
    You can assign multiple channels to a group, but you must add them one at a time. 

Removing channels from a group
==============================

To remove channels from a group, complete the following steps: 

#. Log in to Package Security Manager. 
#. Select |user-groups| **Groups** from the left-hand navigation.
#. Select your group.
#. Click the **Channels** tab.
#. Click |trash| **Remove** beside the channel you want to remove.  
#. Click **Remove** to confirm that you want to remove the channel. 

Deleting a group
================

Only the group owner can delete the group. To delete a group, complete the following steps:

#. Log in to Package Security Manager. 
#. Select |user-groups| **Groups** from the left-hand navigation.
#. Click |trash| **Delete Group** beside the group you want to delete. 
#. Click **Remove** to confirm that you want to delete the group. 

.. |trash| raw:: html

     <i class="fa-light fa-trash" style="color: #ff0000"></i>

.. |gear| raw:: html

    <svg class="inline" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 512 512"><path d="M211.6 28.5c1.6-7.3 8.1-12.5 15.6-12.5h57.6c7.5 0 14 5.2 15.6 12.5l12.9 57.1c.6 2.6 2.5 4.8 5 5.7c17.9 6.8 34.5 16.4 49.1 28.4c2.1 1.7 4.9 2.2 7.4 1.4l56-17.4c7.1-2.2 14.9 .8 18.6 7.3L478.3 161c3.7 6.5 2.5 14.7-3 19.8l-43.1 39.8c-2 1.8-2.9 4.5-2.5 7.2c1.5 9.2 2.3 18.7 2.3 28.4s-.8 19.1-2.3 28.4c-.4 2.6 .5 5.3 2.5 7.2l43.1 39.8c5.5 5.1 6.7 13.3 3 19.8L449.4 401c-3.7 6.5-11.5 9.5-18.6 7.3l-56-17.4c-2.6-.8-5.4-.3-7.4 1.4c-14.6 11.9-31.2 21.6-49.1 28.4c-2.5 1-4.4 3.1-5 5.7l-12.9 57.1c-1.6 7.3-8.1 12.5-15.6 12.5H227.2c-7.5 0-14-5.2-15.6-12.5l-12.9-57.1c-.6-2.6-2.5-4.8-5-5.7c-17.9-6.8-34.5-16.4-49.1-28.4c-2.1-1.7-4.9-2.2-7.4-1.4l-56 17.4c-7.1 2.2-14.9-.8-18.6-7.3L33.7 351c-3.7-6.5-2.5-14.7 3-19.8l43.1-39.8c2-1.8 2.9-4.5 2.5-7.2C80.8 275.1 80 265.7 80 256s.8-19.1 2.3-28.4c.4-2.6-.5-5.3-2.5-7.2L36.7 180.7c-5.5-5.1-6.7-13.3-3-19.8L62.6 111c3.7-6.5 11.5-9.5 18.6-7.3l2.4-7.6-2.4 7.6 56 17.4c2.6 .8 5.4 .3 7.4-1.4c14.6-12 31.2-21.6 49.1-28.4c2.5-1 4.4-3.1 5-5.7l12.9-57.1zM227.2 0c-15 0-27.9 10.4-31.2 25L184 78c-16.7 6.8-32.2 15.8-46.1 26.7L85.9 88.5C71.6 84 56.2 90.1 48.7 103L19.9 153c-7.5 13-5 29.4 6 39.5l39.9 36.9C64.6 238.1 64 247 64 256s.6 17.9 1.8 26.6L25.9 319.5l5.4 5.9-5.4-5.9c-11 10.1-13.5 26.6-6 39.5L48.7 409c7.5 13 22.9 19 37.2 14.6l51.9-16.2c14 10.9 29.5 19.9 46.1 26.7l12 53c3.3 14.6 16.3 25 31.2 25h57.6c15 0 27.9-10.4 31.2-25l12-53c16.7-6.7 32.2-15.8 46.1-26.7l51.9 16.2c14.3 4.4 29.7-1.6 37.2-14.6L492.1 359c7.5-13 5-29.4-6-39.5l-39.9-36.9c1.2-8.7 1.8-17.6 1.8-26.6s-.6-17.9-1.8-26.6l39.9-36.9c11-10.1 13.5-26.6 6-39.5L463.3 103c-7.5-13-22.9-19-37.2-14.6l-51.9 16.2C360.2 93.7 344.7 84.7 328 78L316 25c-3.3-14.6-16.3-25-31.2-25H227.2zM192 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm144 0a80 80 0 1 0 -160 0 80 80 0 1 0 160 0z"/></svg>

.. |circle-plus| raw:: html

    <i class="fa-light fa-circle-plus"></i>

.. |user-groups| raw:: html

    <svg class="inline" width="1.2em" height="1em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M1.5 458.7c6-45.5 29.2-85.6 62.8-113.6C95.3 319.4 135 304 178.3 304H224h45.7c43.3 0 83 15.4 113.9 41.1c33.6 28 56.8 68.1 62.8 113.6c1 7.7 1.5 15.6 1.5 23.6c0 16.4-13.3 29.7-29.7 29.7H398.7 49.3 29.7C13.3 512 0 498.7 0 482.3c0-8 .5-15.9 1.5-23.6zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zm208 0a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM178.3 352c-47.8 0-89.5 25.7-112.2 64c-8.6 14.4-14.4 30.7-16.8 48H98 350h48.8c-.4-2.7-.8-5.3-1.4-8c-2.9-14.3-8.2-27.8-15.5-40c-22.7-38.3-64.4-64-112.2-64H178.3zm431 160H472.4c4.9-8.8 7.6-18.9 7.6-29.7c0-65-29.5-123.2-75.9-161.8c4.3-.4 8.7-.5 13.2-.5h61.4C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7zM432 256c-31 0-59-12.6-79.3-32.9C372.4 196.5 384 163.6 384 128c0-26.8-6.6-52.1-18.3-74.3C384.3 40.1 407.2 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112z"/></svg>