Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit c51f0bb

Browse files
Make changes according to PR comments
1 parent e9e09d7 commit c51f0bb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

datasource_permissions.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import (
66
"fmt"
77
)
88

9+
type DatasourcePermissionType int
10+
11+
const (
12+
_ DatasourcePermissionType = iota // 0 is not a valid permission
13+
DatasourcePermissionQuery
14+
)
15+
916
// DatasourcePermission has information such as a datasource, user, team, role and permission.
1017
type DatasourcePermission struct {
1118
ID int64 `json:"id"`
@@ -16,14 +23,14 @@ type DatasourcePermission struct {
1623

1724
// Permission levels are
1825
// 1 = Query
19-
Permission int64 `json:"permission"`
20-
PermissionName string `json:"permissionName"`
26+
Permission DatasourcePermissionType `json:"permission"`
27+
PermissionName string `json:"permissionName"`
2128
}
2229

2330
type DatasourcePermissionsResponse struct {
24-
DatasourceID int64 `json:"datasourceId"`
25-
Enabled bool `json:"enabled"`
26-
Permissions []*DatasourcePermission
31+
DatasourceID int64 `json:"datasourceId"`
32+
Enabled bool `json:"enabled"`
33+
Permissions []*DatasourcePermission `json:"permissions"`
2734
}
2835

2936
type DatasourcePermissionAddPayload struct {

0 commit comments

Comments
 (0)