Defining user access (permission groups)

On this page you'll learn how to restrict a user access through the creation of permission groups via Control Panel or the API.


Creating permission groups via Control Panel

Permission groups allows you to define fine-grained authorizations for users to interact with the databases, inserting and querying data, using SQL or API, and also get access to the Control Panel and its modules.

You can create a permission group using the Control Panel by accessing the Permission Groups section on the Identity and Access menu where you'll be able to see all the permission groups available in your SlicingDice account. Now you can click on Create New Role and Policy to start the Permission Group Creation Wizard.

First you'll need to define a valid name and description (optional) for this permission group.

Creating an user defining its information on first step

After that click on Save & Continue and define which access permissions this permission group will contain, optional labels and also set specific week days and time that users associated with this permission group can access. You can check the available permissions on the permissions list.

Creating a permission group defining its information on second step

Now, click on Save & Continue and check all the information you've set to this permission group. If everything is fine you can finish this permission group creation, making it available in your permission's groups list.


Creating permission groups via API

You can create a permission group using the API through your own code using your favorite programming language. To do it, you'll need to define an API POST request using the /permission_groups endpoint as you can see on the example below.

curl -X POST https://api.slicingdice.com/v1/permission_groups \
    -H 'Authorization: TEAM_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
    	 	"group-name": "FinancialTeam",
        	"description": "Group of financial employees",
        	"allowed-permissions": [1, 2, 13, 28],
        	"allowed-databases": ["users", "products"],
        	"labels": ["financial", "internal"],
        	"week-days": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"],
        	"access-hours": {
            		"from": "10:00",
            		"to": "02:00"
        		}
	}'

Check the API reference so you can learn how the permission groups creation request and its parameters work.

You can also learn how to edit, delete or retrieve permission groups on this API Reference section.