Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ce98780

Browse files
authored
Merge pull request #148 from lightdash/custom-roles
custom roles docs
2 parents 6d6be57 + b8b96bd commit ce98780

File tree

5 files changed

+130
-23
lines changed

5 files changed

+130
-23
lines changed

‎docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
"group": "Admin",
150150
"pages": [
151151
"references/roles",
152+
"references/custom-roles",
152153
"references/user-attributes",
153154
"guides/how-to-create-multiple-projects",
154155
"guides/customizing-the-appearance-of-your-project",

‎images/create-new-role.png

64.1 KB
Loading[フレーム]

‎images/duplicate-role.png

21.3 KB
Loading[フレーム]

‎references/custom-roles.mdx

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: "Custom Roles"
3+
description: "Custom roles allow you to create granular permission sets tailored to your organization's specific needs. With custom roles, you can define exactly which scopes (permissions) users should have, giving you fine-grained control over access to Lightdash features and resources."
4+
---
5+
6+
<CardGroup cols={3}>
7+
<Card title="Cloud Enterprise" icon="rocket" horizontal>
8+
9+
</Card>
10+
</CardGroup>
11+
12+
<Info>
13+
**Custom roles are only available on Lightdash Enterprise plans.**
14+
15+
For more information on our plans, visit our [pricing page](https://www.lightdash.com/pricing).
16+
</Info>
17+
18+
## Overview
19+
20+
Lightdash provides two types of roles:
21+
22+
- **System roles**: Pre-defined roles (like Admin, Developer, Viewer) with a standard set of scopes. For more information about what these roles can do, check our [default system roles permission matrix](https://docs.lightdash.com/references/roles#roles-and-permissions).
23+
- **Custom roles**: User-defined roles where you can select specific scopes to match your exact requirements
24+
25+
Custom roles are created at the organization level but are assigned to users or groups at the project level, allowing you to control access on a per-project basis.
26+
27+
<Info>
28+
**Additive Permissions**: Lightdash uses an additive permission model. If a user already has a scope granted through their organization-level role, assigning a custom role will not restrict that access. Custom roles can only add permissions, not remove existing ones.
29+
</Info>
30+
31+
## Creating Custom Roles
32+
33+
### Access Custom Roles Settings
34+
35+
1. Navigate to **Settings****General Settings****Custom Roles**
36+
2. You'll see a list of existing custom roles in your organization
37+
38+
### Create a New Role from Scratch
39+
40+
1. Click **Create New Role**
41+
2. Enter a **Role Name** (e.g., "Marketing Analyst", "Finance Viewer")
42+
3. Add an optional **Description** to explain the role's purpose
43+
4. Select the specific **scopes** (permissions) you want to include:
44+
- **View permissions**: Allow users to see content (dashboards, charts, spaces)
45+
- **Create permissions**: Allow users to create new content
46+
- **Manage permissions**: Allow users to edit, delete, or administer content
47+
5. Click **Save** to create the role
48+
49+
![create-new-role.png](/images/create-new-role.png)
50+
51+
### Duplicate an Existing Role
52+
53+
If you want to create a role similar to an existing one:
54+
55+
1. Find the role you want to duplicate (system role or custom role)
56+
2. Click the **** menu next to the role
57+
3. Select **Duplicate Role**
58+
4. Enter a new name for the duplicated role
59+
5. Modify the scopes as needed
60+
6. Click **Save**
61+
62+
This is particularly useful when you want to create a role similar to a system role but with some modifications.
63+
64+
![duplicate-role.png](/images/duplicate-role.png)
65+
66+
## Assigning Custom Roles
67+
68+
Custom roles are assigned at the project level to provide granular access control:
69+
70+
### Assign to Users
71+
72+
1. Go to **Project Settings****Access**
73+
2. Find the user you want to assign a role to
74+
3. Select the custom role from the dropdown
75+
4. The user will now have the permissions defined in that custom role for this project
76+
77+
### Assign to Groups
78+
79+
1. Go to **Project Settings****Access**
80+
2. Find the group you want to assign a role to
81+
3. Select the custom role from the dropdown
82+
4. All members of the group will inherit the custom role permissions for this project
83+
84+
## Troubleshooting
85+
86+
### Users Can't See Expected Content
87+
88+
- Verify the custom role includes the necessary view scopes
89+
- Check that the role is assigned at the project level where the content exists
90+
- Remember that organization-level permissions may override custom role limitations
91+
92+
### Role Changes Not Taking Effect
93+
94+
- Users may need to refresh the page for role changes to take effect
95+
- Verify the role was saved successfully and assigned to the correct users/groups
96+
97+
## Managing Existing Custom Roles
98+
99+
### Edit a Custom Role
100+
101+
1. Go to **Settings****General Settings****Custom Roles**
102+
2. Click on the role you want to edit
103+
3. Modify the name, description, or scopes
104+
4. Click **Save** - changes will apply to all users and groups assigned this role
105+
106+
### Delete a Custom Role
107+
108+
1. First, ensure no users or groups are assigned this role
109+
2. Go to **Settings****General Settings****Custom Roles**
110+
3. Click the **trash icon** next to the role
111+
4. Confirm the deletion
112+
113+
<Info>
114+
**Deleting Roles**: Once deleted, a custom role cannot be recovered. You can't remove a role that is currently assinged to users or groups.
115+
</Info>
116+
117+
Custom roles provide powerful flexibility in managing access to your Lightdash organization. By carefully designing roles that match your team's responsibilities and workflows, you can ensure users have exactly the permissions they need while maintaining security and organization.

‎references/dbt-write-back.mdx

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ description: "dbt Write-Back allows you to develop your models and Metrics in Li
44
---
55

66
<Info>
7-
* dbt Write-Back is currently only available for dbt projects hosted in GitHub.
8-
9-
* You need to be at least a [project `Developer`](/references/roles) to use dbt Write-Back.
7+
- dbt Write-Back is currently only available for dbt projects hosted in GitHub and GitLab.
8+
- You need to be at least a [`project Developer`](/references/roles) to use dbt Write-Back.
109
</Info>
1110

1211
## Write back Metrics from Custom Metrics
@@ -50,18 +49,15 @@ To get started, create a [Custom Dimension](/references/custom-fields#custom-dim
5049
1. Click `Write back to dbt`
5150

5251
![](/images/references/write-back-custom-dimension-1.png)
53-
5452
2. Preview the Dimension YAML and open a pull request.
5553

5654
![](/images/references/write-back-custom-dimension-2.png)
57-
5855
3. Approve and merge the pull request in your dbt project.
5956

6057
![](/images/references/write-back-custom-dimension-3.png)
6158

6259
Once the pull request with your new Dimension is merged, you can click `Refresh dbt` in Lightdash (or, if you're [using GitHub actions](../guides/cli/how-to-use-lightdash-deploy#automatically-deploy-your-changes-to-lightdash-using-a-github-action), your project will automatically refresh once your changes are merged).
6360

64-
6561
### Known limitations
6662

6763
##### Bin Dimensions
@@ -72,40 +68,36 @@ Writing back bin Dimensions is not supported at the moment. If you want to help
7268

7369
At the moment, if you write back a Custom Dimension to your dbt project's YAML, the Custom Dimension will not be automatically replaced with the new YAML Dimension. Once your new Dimension is created in dbt, you'll need to manually update your charts and replace the Custom Dimensions with the new Dimension.
7470

75-
7671
## Write back dbt Models from the SQL Runner
7772

7873
You can use Lightdash to build models in dbt from queries that you've built in the SQL runner. We recommend writing back models from the SQL runner if you're planning to use the query regularly so it can be easily used, governed and managed like other dbt models in your Lightdash project.
7974

8075
To get started, build and run a query in the SQL runner, then select the `Write back to dbt` option from the `Save` drop-down.
8176

8277
<Frame>
83-
<imgsrc="/images/references/assets/images/dbt-write-back-3774e219cdb58ad09a5e290b28e8b427.jpg" />
78+
![](/images/references/assets/images/dbt-write-back-3774e219cdb58ad09a5e290b28e8b427.jpg)
8479
</Frame>
8580

86-
You'll be asked to enter a name that will be used as the model name and file names in your dbt project. Clicking `Open pull request` will open a pull request created by Lightdash against your dbt project in GitHub.
81+
You'll be asked to enter a name that will be used as the model name and file names in your dbt project. Clicking `Open pull request` will open a pull request created by Lightdash against your dbt project in GitHub or GitLab.
8782

8883
<Frame>
89-
<imgsrc="/images/references/assets/images/write-back-pull-request-5c36c33617a258728a644d1e76896725.jpg" />
84+
![](/images/references/assets/images/write-back-pull-request-5c36c33617a258728a644d1e76896725.jpg)
9085
</Frame>
9186

9287
The new model will be written to your dbt project in a `models/lightdash/` directory. The model will have the tag `created-by-lightdash` included in the model config.
9388

94-
9589
### Getting your model to appear as a `Table` in Lightdash
9690

9791
You might need to adjust your Table Configuration settings in your project to have your new models appear as Tables in Lightdash.
9892

9993
If you've selected:
10094

101-
* `Show entire project` then you don't need to do anything. The models should appear automatically if you refresh your dbt project connection.
102-
103-
* `Show models with any of these tags`, you'll need to add `created-by-lightdash` to the list of accepted tags. By default, models that you write back to dbt will have the tag `created-by-lightdash` included in the model config.
104-
105-
* `Show models in this list`, you'll need to manually add the new models to the list of accepted models here.
95+
- `Show entire project` then you don't need to do anything. The models should appear automatically if you refresh your dbt project connection.
96+
- `Show models with any of these tags`, you'll need to add `created-by-lightdash` to the list of accepted tags. By default, models that you write back to dbt will have the tag `created-by-lightdash` included in the model config.
97+
- `Show models in this list`, you'll need to manually add the new models to the list of accepted models here.
10698

10799
<Frame>
108-
<imgsrc="/images/references/assets/images/tables-configuration-write-back-c4be0ae3c4c13aab3c93a81e4956cd4d.jpg" />
100+
![](/images/references/assets/images/tables-configuration-write-back-c4be0ae3c4c13aab3c93a81e4956cd4d.jpg)
109101
</Frame>
110102

111103
### Running your models in dbt
@@ -114,22 +106,19 @@ If you get an `Error: not found your_table_name`, it's likely because you haven'
114106

115107
#### Manual approach
116108

117-
Once your model is merged to your dbt project, you can run `dbt run -s your_model_name_here` to create the table in your data warehouse. You might need to add `--target prod` if your default profile is set to `dev`!
109+
Once your model is merged to your dbt project, you can run `dbt run -s your_model_name_here` to create the table in your data warehouse. You might need to add `--target prod` if your default profile is set to `dev`\!
118110

119111
#### Automated approach using dbt Cloud
120112

121113
If you're using dbt Cloud to manage your dbt project, you can create a job that will automatically run any new models with the tag `created-by-lightdash`.
122114

123115
To create a job that does this, you'll want to:
124116

125-
1. open dbt Cloud, head to `Deploy` --> `Jobs` and click `create new job`
126-
117+
1. open dbt Cloud, head to `Deploy` --\> `Jobs` and click `create new job`
127118
2. toggle on `triggered by pull requests` in the `Git Trigger` section
128-
129119
3. add the command `dbt run --select tag:created-by-lightdash`
130-
131120
4. set `compare changes against environment` to `prod`. This will make sure that this job only runs when a model is changed from your pull request
132121

133122
<Frame>
134-
<imgsrc="/images/references/assets/images/dbt-cloud-run-automatically-561d3a59b2dc47a003adaf926fbe5a3b.jpg" />
123+
![](/images/references/assets/images/dbt-cloud-run-automatically-561d3a59b2dc47a003adaf926fbe5a3b.jpg)
135124
</Frame>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /