# Custom User Groups

Apart from making the block accessible to logged-in or non-logged-in user, you can also create **User Groups** with custom conditions and add one or more user groups to block's visibility settings, so that only those groups can access the block. Let's see how **User Groups** are created.

## Creating User Groups

To create a user group, you need to navigate to **Settings => User Groups & Permissions => User Groups**. The **Logged in users** groups will always be there by default, and you can use the **Add user group** button at the bottom to create a new custom group.

![Adding a user group](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-Mfw4zmFgbbu3zryLFcc%2F-Mfw7D6lkwd1VWg3FtJD%2Fadding-user-group-b.png?alt=media\&token=ce9c31af-e461-4987-b006-14600127d532)

In the pop-up that opens next, you first need to set a name for the group.

![](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-Mfw4zmFgbbu3zryLFcc%2F-Mfw9-CzjQfS3ScD78AQ%2Fname-b.png?alt=media\&token=afd85461-4021-4f12-ba37-657d26f9c160)

Further on, you need to add all the necessary conditions based on which the user will be included in the group. Let's see how that works.

## Creating Conditions

First of all, from the dropdown at the top you should choose whether the user needs to meet **any** or **all** of the conditions defined below to be included in the group.

![All or any of the conditions](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-Mfw4zmFgbbu3zryLFcc%2F-Mfw9sdv19XBb5-sMnWj%2Fany-b%20\(1\).png?alt=media\&token=c4797888-3a64-482d-b859-2ba47a8e2e57)

You can add as many conditions as required, and they'll be joined with OR (**match** **any** is selected) or AND (**match** **all** is selected).

!["Match any" option selected](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-Mfw4zmFgbbu3zryLFcc%2F-MfwADQPusYs0KGlyczk%2Ftwo-conditions-b.png?alt=media\&token=f9807d70-80c8-4d91-8231-6c97c8f5f87c)

Now, let's add a condition using the **Add condition** button to see how it's configured. There are three fields in **Condition Settings**, so let's see how each of those works.

![Condition settings](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-Mfw4zmFgbbu3zryLFcc%2F-MfwAVO2ptJ_1HVORapS%2Fcondition-fields-b.png?alt=media\&token=d71794ef-3269-4082-a1a9-c4f45974720f)

### Condition Settings

![Select attribute](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MfwGRgifBE2SFW3HPCg%2F-MfwIgghrOqYuh44V3lP%2Fcond-settings-b.png?alt=media\&token=103344e8-60a8-42bf-bc5b-38c1800d5cde)

First, you need to select the attribute for which you want to set a condition. There are the following options:

* **One-time Product**
* **Subscription**&#x20;
* **Logged in User's**

The first two are [payment-related conditions](https://softr.gitbook.io/softr-documentation/memberships/block-visibility/payment-and-other-conditions/payment-conditions) and the last one is based on [logged in user's attributes](https://softr.gitbook.io/softr-documentation/memberships/block-visibility/payment-and-other-conditions/user-conditions).&#x20;

We will do a detailed overview of each condition type in the subsections to this article, but now let's complete the user group creation and see how it's assigned to the block.

## Creating the Group and Adding In in Block's Visibility

As soon as you've set all the necessary conditions, just hit the **Create user group** button and the created group will appear in your list of user groups.

![Create user group](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MfwKHNsdCuwCxgvE0DH%2F-MfwKRji_maxuD6GLw69%2Fcreate-group-b.png?alt=media\&token=2eceac72-5965-49f2-9c0a-0de46c43ff95)

Now you can use the created group when defining the visibility conditions for a particular block. Navigate to block's visibility settings, select **Logged in users**, click **Add user group**, and select the group from the list.&#x20;

<figure><img src="https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FIaYcNzx20s9ltM2DVUdQ%2FScreen%20Recording%202022-09-05%20at%2011.48.31.gif?alt=media&#x26;token=41802575-0c4f-422e-bee0-96b19078e14a" alt=""><figcaption><p>Selecting the user group</p></figcaption></figure>

That's it. **Now, only the users that are part of the selected group will be able to access the block.** Please, not that you can add more than one user group to a given block.
