File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ other) groupings.
130
130
131
131
---8<-- 'includes/generated_docs/language__ measures.md'
132
132
133
+ ---
134
+
133
135
134
136
## Parameters
135
137
@@ -139,3 +141,10 @@ from the [command line](cli.md#generate-dataset.user_args).
139
141
---8<-- 'includes/generated_docs/language__ parameters.md'
140
142
141
143
---
144
+
145
+
146
+ ## Permissions
147
+
148
+ ---8<-- 'includes/generated_docs/language__ permissions.md'
149
+
150
+ ---
Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ def build_language():
110
110
"parameters" : {
111
111
"get_parameter" : namespace ["get_parameter" ],
112
112
},
113
+ "permissions" : {
114
+ "claim_permissions" : namespace ["claim_permissions" ],
115
+ },
113
116
}
114
117
115
118
# Check that the documentation is complete
Original file line number Diff line number Diff line change @@ -16,6 +16,24 @@ class EHRQLPermissionError(Exception):
16
16
17
17
18
18
def claim_permissions (* permissions ):
19
+ """
20
+ Some tables and features in ehrQL can only be accessed with specific permission set
21
+ by the OpenSAFELY team. These restrictions are only enforced when working with real
22
+ data, however to avoid confusion we also check them when working with dummy data.
23
+
24
+ When using dummy data you can grant yourself any permission using the
25
+ `claim_permissions()` function. For example:
26
+
27
+ from ehrql import claim_permissions
28
+
29
+ claim_permissions("some_permission", "another_permission")
30
+
31
+ This can go anywhere in your dataset or measure definition file.
32
+
33
+ This will allow you to develop your ehrQL code locally. But please **note that you
34
+ will only be able to run against real data if you have had the necessary permissions
35
+ granted by the OpenSAFELY team**.
36
+ """
19
37
for permission in permissions :
20
38
# Use dictionary as convenient ordered set
21
39
CLAIMED_PERMISSIONS [permission ] = True
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ def test_render(tmp_path):
56
56
"language__functions.md" ,
57
57
"language__measures.md" ,
58
58
"language__parameters.md" ,
59
+ "language__permissions.md" ,
59
60
"language__series.md" ,
60
61
"schemas" ,
61
62
"schemas.md" ,
You can’t perform that action at this time.
0 commit comments