@@ -11,11 +11,11 @@ toc_max_heading_level: 4
11
11
sidebar_class_name : sidebar-divider-bottom
12
12
---
13
13
14
- # Permissions Protect Data
14
+ # Protect Data
15
15
16
16
## Introduction
17
17
18
- Permissions keep data secure by allowing you to control what data can be accessed through PromptQL conversations by
18
+ ** Permissions** keep data secure by allowing you to control what data can be accessed through PromptQL conversations by
19
19
which user roles. This ensures that when users talk to their data using PromptQL, they only see the information they're
20
20
authorized to access.
21
21
@@ -33,19 +33,14 @@ the `admin` role by default.
33
33
34
34
All other permissions for all other user roles must be added manually.
35
35
36
- ## Create permissions
36
+ ## Create a permission
37
37
38
38
### Row access
39
39
40
40
You can create a ` ModelPermission ` object to implement row-level security and restrict which rows a user can access
41
41
through PromptQL.
42
42
43
- For example, to only allow users to access their own records in the ` Users ` table when talking to their data through
44
- PromptQL:
45
-
46
- ``` yaml title=""
47
- ---
48
- # e.g., Users.hml
43
+ ``` yaml title="For example, to only allow users to access their own records in the Users table when talking to their data through PromptQL:"
49
44
kind : ModelPermissions
50
45
version : v1
51
46
definition :
@@ -77,8 +72,6 @@ To restrict which fields can be accessed through PromptQL conversations, you can
77
72
Below, the user role can only access the ` name ` field, not the ` id ` field which the admin role can.
78
73
79
74
``` yaml title="The user role can only access their name field:"
80
- # e.g., Users.hml
81
- ---
82
75
kind : TypePermissions
83
76
version : v1
84
77
definition :
@@ -104,8 +97,6 @@ To determine which commands can be executed by which roles when interacting with
104
97
` CommandPermission ` object.
105
98
106
99
``` yaml title="In this example, we'll make it so a user can update their own record:"
107
- # e.g., UpdateUsersById.hml
108
- ---
109
100
kind : CommandPermissions
110
101
version : v1
111
102
definition :
@@ -126,20 +117,22 @@ definition:
126
117
When a user asks PromptQL to update their information, these permissions ensure that they can only modify their own
127
118
records.
128
119
129
- ## Update permissions
120
+ ## Update a permission
130
121
131
122
Since all permissions are stored in metadata, you can use your text editor to find and update them easily.
132
123
133
124
For example, to check everything which the ` user ` role can access when talking to data through PromptQL, search for
134
125
` - role: user ` and analyze the results.
135
126
136
- ## Deleting permissions
127
+ ## Delete a permission
137
128
138
129
If you no longer need a role, find all mentions of it in your metadata and remove them all.
139
130
140
131
If you no longer need a particular permission, simply remove it from the relevant ` ModelPermissions ` , ` TypePermissions ` ,
141
132
or ` CommandPermissions ` object.
142
133
143
- ## Reference
134
+ ## Next steps
144
135
145
- You can learn more about permissions in the metadata reference [ docs] ( /reference/metadata-reference/permissions.mdx ) .
136
+ - Now that you've been through the major building blocks of your semantic metadata layer, check out the
137
+ [ business logic section] ( /business-logic/index.mdx ) to learn how to place more tools in PromptQL's toolbox.
138
+ - You can learn more about permissions in the metadata reference [ docs] ( /reference/metadata-reference/permissions.mdx ) .
0 commit comments