This repository was archived by the owner on Jan 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ type DatasourcePermission struct {
2525
2626 // Permission levels are
2727 // 1 = Query
28+ // 2 = Edit
2829 Permission DatasourcePermissionType `json:"permission"`
2930 PermissionName string `json:"permissionName"`
3031}
@@ -36,9 +37,10 @@ type DatasourcePermissionsResponse struct {
3637}
3738
3839type DatasourcePermissionAddPayload struct {
39- UserID int64 `json:"userId"`
40- TeamID int64 `json:"teamId"`
41- Permission DatasourcePermissionType `json:"permission"`
40+ UserID int64 `json:"userId"`
41+ TeamID int64 `json:"teamId"`
42+ BuiltInRole string `json:"builtinRole"`
43+ Permission DatasourcePermissionType `json:"permission"`
4244}
4345
4446// EnableDatasourcePermissions enables the datasource permissions (this is a datasource setting)
Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ const (
3131 "permissionName": "Query",
3232 "created": "2017-06-20T02:00:00+02:00",
3333 "updated": "2017-06-20T02:00:00+02:00"
34+ },
35+ {
36+ "datasourceId": 1,
37+ "permission": 2,
38+ "permissionName": "Edit",
39+ "builtInRole": "Viewer",
40+ "created": "2017-06-20T02:00:00+02:00",
41+ "updated": "2017-06-20T02:00:00+02:00"
3442 }
3543 ]
3644}`
@@ -93,6 +101,10 @@ func TestAddDatasourcePermissions(t *testing.T) {
93101 UserID : 11 ,
94102 Permission : 1 ,
95103 },
104+ {
105+ BuiltInRole : "Viewer" ,
106+ Permission : 2 ,
107+ },
96108 } {
97109 err := client .AddDatasourcePermission (1 , item )
98110 if err != nil {
You can’t perform that action at this time.
0 commit comments