diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2fc3f3d..525ae61 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+BREAKING CHANGES:
+
+- Support Metabase v\*.50, and drop support for earlier versions.
+- `metabase_permissions_graph`'s permissions support two new fields: `view_data` and `create_queries`. The `native` field is no longer supported.
+
## 0.7.0 (2024-06-27)
NEW FEATURES:
diff --git a/docs/resources/permissions_graph.md b/docs/resources/permissions_graph.md
index 975bbdb..60c9b67 100644
--- a/docs/resources/permissions_graph.md
+++ b/docs/resources/permissions_graph.md
@@ -46,23 +46,17 @@ resource "metabase_permissions_graph" "graph" {
permissions = [
{
- group = metabase_permissions_group.data_analysts.id
- database = metabase_database.bigquery.id
- data = {
- # Native: Yes
- native = "write"
- # Data access: Unrestricted
- schemas = "all"
- }
+ group = metabase_permissions_group.data_analysts.id
+ database = metabase_database.bigquery.id
+ view_data = "unrestricted"
+ create_queries = "query-builder-and-native"
},
{
group = metabase_permissions_group.business_stakeholders.id
database = metabase_database.bigquery.id
- data = {
- # Native: No (by omitting the `native` attribute or setting it to "none")
- # Data access: Unrestricted
- schemas = "all"
- }
+ # This looks like no other value can be set, at least in the free version of Metabase.
+ view_data = "unrestricted"
+ create_queries = "query-builder"
},
# Permissions for the "All Users" group. Those cannot be removed entirely, but they can be limited.
# The example below gives the minimum set of permissions for the free version of Metabase:
@@ -71,12 +65,11 @@ resource "metabase_permissions_graph" "graph" {
database = metabase_database.bigquery.id
# Cannot be removed but has no impact when using the free version of Metabase.
download = {
- native = "full"
schemas = "full"
}
- # Omitting the `data` attribute entirely results in the lowest level of permissions:
- # Data access: No self-service
- # Native: No
+ view_data = "unrestricted"
+ # This gives the least access possible.
+ create_queries = "no"
},
]
}
@@ -103,31 +96,22 @@ resource "metabase_permissions_graph" "graph" {
Required:
+- `create_queries` (String) The permission definition for creating queries.
- `database` (Number) The ID of the database to which the permission applies.
- `group` (Number) The ID of the group to which the permission applies.
+- `view_data` (String) The permission definition for data access.
Optional:
-- `data` (Attributes) The permission definition for data access. (see [below for nested schema](#nestedatt--permissions--data))
- `data_model` (Attributes) The permission definition for accessing the data model. (see [below for nested schema](#nestedatt--permissions--data_model))
- `details` (String) The permission definition for accessing details.
- `download` (Attributes) The permission definition for downloading data. (see [below for nested schema](#nestedatt--permissions--download))
-
-### Nested Schema for `permissions.data`
-
-Optional:
-
-- `native` (String) The permission for native SQL querying
-- `schemas` (String) The permission to access data through the Metabase interface
-
-
### Nested Schema for `permissions.data_model`
Optional:
-- `native` (String) The permission for native SQL querying
- `schemas` (String) The permission to access data through the Metabase interface
@@ -136,7 +120,6 @@ Optional:
Optional:
-- `native` (String) The permission for native SQL querying
- `schemas` (String) The permission to access data through the Metabase interface
## Import
diff --git a/examples/resources/metabase_permissions_graph/resource.tf b/examples/resources/metabase_permissions_graph/resource.tf
index b98b70b..441eaf3 100644
--- a/examples/resources/metabase_permissions_graph/resource.tf
+++ b/examples/resources/metabase_permissions_graph/resource.tf
@@ -22,23 +22,17 @@ resource "metabase_permissions_graph" "graph" {
permissions = [
{
- group = metabase_permissions_group.data_analysts.id
- database = metabase_database.bigquery.id
- data = {
- # Native: Yes
- native = "write"
- # Data access: Unrestricted
- schemas = "all"
- }
+ group = metabase_permissions_group.data_analysts.id
+ database = metabase_database.bigquery.id
+ view_data = "unrestricted"
+ create_queries = "query-builder-and-native"
},
{
group = metabase_permissions_group.business_stakeholders.id
database = metabase_database.bigquery.id
- data = {
- # Native: No (by omitting the `native` attribute or setting it to "none")
- # Data access: Unrestricted
- schemas = "all"
- }
+ # This looks like no other value can be set, at least in the free version of Metabase.
+ view_data = "unrestricted"
+ create_queries = "query-builder"
},
# Permissions for the "All Users" group. Those cannot be removed entirely, but they can be limited.
# The example below gives the minimum set of permissions for the free version of Metabase:
@@ -47,12 +41,11 @@ resource "metabase_permissions_graph" "graph" {
database = metabase_database.bigquery.id
# Cannot be removed but has no impact when using the free version of Metabase.
download = {
- native = "full"
schemas = "full"
}
- # Omitting the `data` attribute entirely results in the lowest level of permissions:
- # Data access: No self-service
- # Native: No
+ view_data = "unrestricted"
+ # This gives the least access possible.
+ create_queries = "no"
},
]
}
diff --git a/internal/provider/permissions_graph_resource.go b/internal/provider/permissions_graph_resource.go
index eaad017..9e8d81b 100644
--- a/internal/provider/permissions_graph_resource.go
+++ b/internal/provider/permissions_graph_resource.go
@@ -41,38 +41,35 @@ type PermissionsGraphResourceModel struct {
// The model for a single edge in the permissions graph.
type DatabasePermissions struct {
- Group types.Int64 `tfsdk:"group"` // The ID of the permissions group to which the permission applies.
- Database types.Int64 `tfsdk:"database"` // The ID of the database to which the permission applies.
- Data types.Object `tfsdk:"data"` // Data-related permission.
- Download types.Object `tfsdk:"download"` // Download-related permission (only available with advanced permissions).
- DataModel types.Object `tfsdk:"data_model"` // Data-model-related permission (only available with advanced permissions).
- Details types.String `tfsdk:"details"` // Details permission (only available with advanced permissions).
+ Group types.Int64 `tfsdk:"group"` // The ID of the permissions group to which the permission applies.
+ Database types.Int64 `tfsdk:"database"` // The ID of the database to which the permission applies.
+ ViewData types.String `tfsdk:"view_data"` // View data access permission.
+ CreateQueries types.String `tfsdk:"create_queries"` // Create queries access permission.
+ Download types.Object `tfsdk:"download"` // Download-related permission (only available with advanced permissions).
+ DataModel types.Object `tfsdk:"data_model"` // Data-model-related permission (only available with advanced permissions).
+ Details types.String `tfsdk:"details"` // Details permission (only available with advanced permissions).
}
// The object type definition for the `DatabasePermissions` model.
var databasePermissionsObjectType = types.ObjectType{
AttrTypes: map[string]attr.Type{
- "group": types.Int64Type,
- "database": types.Int64Type,
- "data": accessPermissionsObjectType,
- "download": accessPermissionsObjectType,
- "data_model": accessPermissionsObjectType,
- "details": types.StringType,
+ "group": types.Int64Type,
+ "database": types.Int64Type,
+ "view_data": types.StringType,
+ "create_queries": types.StringType,
+ "download": accessPermissionsObjectType,
+ "data_model": accessPermissionsObjectType,
+ "details": types.StringType,
},
}
// The model for a single permission setting in an edge of the graph.
type AccessPermissions struct {
- Native types.String `tfsdk:"native"` // Native-access (SQL) permissions.
Schemas types.String `tfsdk:"schemas"` // Schemas permissions.
}
// The schema for the `AccessPermissions` model.
var accessPermissionAttributes = map[string]schema.Attribute{
- "native": schema.StringAttribute{
- MarkdownDescription: "The permission for native SQL querying",
- Optional: true,
- },
"schemas": schema.StringAttribute{
MarkdownDescription: "The permission to access data through the Metabase interface",
Optional: true,
@@ -82,7 +79,6 @@ var accessPermissionAttributes = map[string]schema.Attribute{
// The object type definition for the `AccessPermissions` model.
var accessPermissionsObjectType = types.ObjectType{
AttrTypes: map[string]attr.Type{
- "native": types.StringType,
"schemas": types.StringType,
},
}
@@ -124,10 +120,13 @@ Permissions for the Administrators group cannot be changed. To avoid issues duri
MarkdownDescription: "The ID of the database to which the permission applies.",
Required: true,
},
- "data": schema.SingleNestedAttribute{
+ "view_data": schema.StringAttribute{
MarkdownDescription: "The permission definition for data access.",
- Optional: true,
- Attributes: accessPermissionAttributes,
+ Required: true,
+ },
+ "create_queries": schema.StringAttribute{
+ MarkdownDescription: "The permission definition for creating queries.",
+ Required: true,
},
"download": schema.SingleNestedAttribute{
MarkdownDescription: "The permission definition for downloading data.",
@@ -166,7 +165,6 @@ func makeAccessPermissionsFromDatabaseAccess(ctx context.Context, da *metabase.P
}
obj, diags := types.ObjectValueFrom(ctx, accessPermissionsObjectType.AttrTypes, AccessPermissions{
- Native: stringValueOrNull(da.Native),
Schemas: stringValueOrNull(&schemas),
})
if diags.HasError() {
@@ -192,10 +190,9 @@ func makePermissionsObjectFromDatabasePermissions(ctx context.Context, groupId s
return nil, diags
}
- dataAccess, accessDiags := makeAccessPermissionsFromDatabaseAccess(ctx, p.Data)
- diags.Append(accessDiags...)
- if diags.HasError() {
- return nil, diags
+ createQueries := metabase.PermissionsGraphDatabasePermissionsCreateQueriesNo
+ if p.CreateQueries != nil {
+ createQueries = *p.CreateQueries
}
downloadAccess, accessDiags := makeAccessPermissionsFromDatabaseAccess(ctx, p.Download)
@@ -211,12 +208,13 @@ func makePermissionsObjectFromDatabasePermissions(ctx context.Context, groupId s
}
permissionsObject, objectDiags := types.ObjectValueFrom(ctx, databasePermissionsObjectType.AttrTypes, DatabasePermissions{
- Group: types.Int64Value(int64(groupIdInt)),
- Database: types.Int64Value(int64(dbIdInt)),
- Data: *dataAccess,
- Download: *downloadAccess,
- DataModel: *dataModelAccess,
- Details: stringValueOrNull(p.Details),
+ Group: types.Int64Value(int64(groupIdInt)),
+ Database: types.Int64Value(int64(dbIdInt)),
+ ViewData: types.StringValue(string(p.ViewData)),
+ CreateQueries: types.StringValue(string(createQueries)),
+ Download: *downloadAccess,
+ DataModel: *dataModelAccess,
+ Details: stringValueOrNull(p.Details),
})
diags.Append(objectDiags...)
if diags.HasError() {
@@ -275,28 +273,19 @@ func updateModelFromPermissionsGraph(ctx context.Context, g metabase.Permissions
// Makes a Metabase API `PermissionsGraphDatabaseAccess` struct from a Terraform model object.
// `setIfNull` can be used to set the default values (forbidding any access) to permissions.
// This is useful when removing permissions for example.
-// `setNative` determines whether the `native` attribute should be set in the access object.
-// This is useful because the "data model" permission does not support it.
-func makeDatasetAccessFromModel(ctx context.Context, apObj types.Object, setIfNull bool, setNative bool) (*metabase.PermissionsGraphDatabaseAccess, diag.Diagnostics) {
+func makeDatasetAccessFromModel(ctx context.Context, apObj types.Object, setIfNull bool) (*metabase.PermissionsGraphDatabaseAccess, diag.Diagnostics) {
var diags diag.Diagnostics
if !setIfNull && apObj.IsNull() {
return nil, diags
}
- // Default values ("none") forbid any access.
- var native *metabase.PermissionsGraphDatabaseAccessNative
-
var schemas metabase.PermissionsGraphDatabaseAccess_Schemas
err := schemas.FromPermissionsGraphDatabaseAccessSchemas0(metabase.PermissionsGraphDatabaseAccessSchemas0None)
if err != nil {
diags.AddError("Unexpected error setting schemas to none value", err.Error())
return nil, diags
}
- if setNative {
- none := metabase.PermissionsGraphDatabaseAccessNativeNone
- native = &none
- }
if !apObj.IsNull() {
var ap AccessPermissions
@@ -306,11 +295,6 @@ func makeDatasetAccessFromModel(ctx context.Context, apObj types.Object, setIfNu
return nil, diags
}
- if setNative && !ap.Native.IsNull() {
- nativeValue := metabase.PermissionsGraphDatabaseAccessNative(ap.Native.ValueString())
- native = &nativeValue
- }
-
if !ap.Schemas.IsNull() {
err := schemas.FromPermissionsGraphDatabaseAccessSchemas0(metabase.PermissionsGraphDatabaseAccessSchemas0(ap.Schemas.ValueString()))
if err != nil {
@@ -321,7 +305,6 @@ func makeDatasetAccessFromModel(ctx context.Context, apObj types.Object, setIfNu
}
return &metabase.PermissionsGraphDatabaseAccess{
- Native: native,
Schemas: &schemas,
}, diags
}
@@ -367,19 +350,21 @@ func makePermissionsGraphFromModel(ctx context.Context, data PermissionsGraphRes
return nil, diags
}
- data, accessDiags := makeDatasetAccessFromModel(ctx, p.Data, true, true)
- diags.Append(accessDiags...)
- if diags.HasError() {
- return nil, diags
+ viewData := metabase.PermissionsGraphDatabasePermissionsViewData(p.ViewData.ValueString())
+
+ createQueries := valueApproximateStringOrNull[metabase.PermissionsGraphDatabasePermissionsCreateQueries](p.CreateQueries)
+ if createQueries == nil {
+ no := metabase.PermissionsGraphDatabasePermissionsCreateQueriesNo
+ createQueries = &no
}
- download, accessDiags := makeDatasetAccessFromModel(ctx, p.Download, advancedPermissions, true)
+ download, accessDiags := makeDatasetAccessFromModel(ctx, p.Download, advancedPermissions)
diags.Append(accessDiags...)
if diags.HasError() {
return nil, diags
}
- dataModel, accessDiags := makeDatasetAccessFromModel(ctx, p.DataModel, advancedPermissions, false)
+ dataModel, accessDiags := makeDatasetAccessFromModel(ctx, p.DataModel, advancedPermissions)
diags.Append(accessDiags...)
if diags.HasError() {
return nil, diags
@@ -387,15 +372,16 @@ func makePermissionsGraphFromModel(ctx context.Context, data PermissionsGraphRes
details := valueApproximateStringOrNull[metabase.PermissionsGraphDatabasePermissionsDetails](p.Details)
if details == nil && advancedPermissions {
- no := metabase.No
+ no := metabase.PermissionsGraphDatabasePermissionsDetailsNo
details = &no
}
dbPermMap[databaseId] = metabase.PermissionsGraphDatabasePermissions{
- Data: data,
- Download: download,
- DataModel: dataModel,
- Details: details,
+ ViewData: viewData,
+ CreateQueries: createQueries,
+ Download: download,
+ DataModel: dataModel,
+ Details: details,
}
}
@@ -436,31 +422,24 @@ func makePermissionsGraphFromModel(ctx context.Context, data PermissionsGraphRes
continue
}
- // If the permission does not exist in the plan but exists in the state, it should be explicitly deleted by
- // creating the permission with "none" values.
- nativeNone := metabase.PermissionsGraphDatabaseAccessNativeNone
-
var schemasNone metabase.PermissionsGraphDatabaseAccess_Schemas
err := schemasNone.FromPermissionsGraphDatabaseAccessSchemas0(metabase.PermissionsGraphDatabaseAccessSchemas0None)
if err != nil {
diags.AddError("Unexpected error setting schema none value", err.Error())
return nil, diags
}
+ no := metabase.PermissionsGraphDatabasePermissionsCreateQueriesNo
deletedPermissions := metabase.PermissionsGraphDatabasePermissions{
- Data: &metabase.PermissionsGraphDatabaseAccess{
- Native: &nativeNone,
- Schemas: &schemasNone,
- },
+ CreateQueries: &no,
}
if advancedPermissions {
deletedPermissions.Download = &metabase.PermissionsGraphDatabaseAccess{
- Native: &nativeNone,
Schemas: &schemasNone,
}
deletedPermissions.DataModel = &metabase.PermissionsGraphDatabaseAccess{
Schemas: &schemasNone,
}
- no := metabase.No
+ no := metabase.PermissionsGraphDatabasePermissionsDetailsNo
deletedPermissions.Details = &no
}
dbPermMap[databaseId] = deletedPermissions
diff --git a/internal/provider/permissions_graph_resource_test.go b/internal/provider/permissions_graph_resource_test.go
index 70adbc9..b70bfd5 100644
--- a/internal/provider/permissions_graph_resource_test.go
+++ b/internal/provider/permissions_graph_resource_test.go
@@ -4,18 +4,11 @@ import (
"fmt"
"testing"
+ "github.com/flovouin/terraform-provider-metabase/metabase"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)
-func testAccPermissionsGraphResource(setData bool) string {
- data := ""
- if setData {
- data = `data = {
- native = "write"
- schemas = "all"
- }`
- }
-
+func testAccPermissionsGraphResource(createQueries string) string {
return fmt.Sprintf(`
import {
to = metabase_permissions_graph.graph
@@ -30,15 +23,15 @@ resource "metabase_permissions_graph" "graph" {
group = 1
database = 1
download = {
- native = "full"
schemas = "full"
}
- %s
+ view_data = "unrestricted"
+ create_queries = "%s"
},
]
}
`,
- data,
+ createQueries,
)
}
@@ -47,14 +40,14 @@ func TestAccPermissionsGraphResource(t *testing.T) {
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
- Config: providerApiKeyConfig + testAccPermissionsGraphResource(true),
+ Config: providerApiKeyConfig + testAccPermissionsGraphResource(string(metabase.PermissionsGraphDatabasePermissionsCreateQueriesQueryBuilderAndNative)),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("metabase_permissions_graph.graph", "advanced_permissions", "false"),
resource.TestCheckResourceAttrSet("metabase_permissions_graph.graph", "revision"),
),
},
{
- Config: providerApiKeyConfig + testAccPermissionsGraphResource(false),
+ Config: providerApiKeyConfig + testAccPermissionsGraphResource(string(metabase.PermissionsGraphDatabasePermissionsCreateQueriesNo)),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("metabase_permissions_graph.graph", "advanced_permissions", "false"),
resource.TestCheckResourceAttrSet("metabase_permissions_graph.graph", "revision"),
diff --git a/metabase-api.yaml b/metabase-api.yaml
index 9fb6543..5b20201 100644
--- a/metabase-api.yaml
+++ b/metabase-api.yaml
@@ -1264,8 +1264,22 @@ components:
type: object
description: The permissions related to a single database.
properties:
- data:
- $ref: "#/components/schemas/PermissionsGraphDatabaseAccess"
+ view-data:
+ type: string
+ description: The permission definition for viewing data.
+ enum:
+ - unrestricted
+ - "no"
+ - legacy-no-self-service
+ - blocked
+ - impersonated
+ create-queries:
+ type: string
+ description: The permission definition for creating queries.
+ enum:
+ - "no"
+ - query-builder-and-native
+ - query-builder
download:
$ref: "#/components/schemas/PermissionsGraphDatabaseAccess"
data-model:
@@ -1276,17 +1290,14 @@ components:
enum:
- "yes"
- "no"
+ required:
+ # The falsy "no" value does not seem to be handled by the API. It is hard to know whether this property is
+ # actually required, or if it can disappear when it's "no".
+ - view-data
PermissionsGraphDatabaseAccess:
type: object
description: The permissions for a single access type.
properties:
- native:
- type: string
- description: Whether "Native query editing" is allowed.
- enum:
- - full
- - write
- - none
schemas:
# The `schemas` property can either be a string or an object. The API returns an object in two cases:
# 1. Permissions are set to "granular" and some tables have different permissions than others
diff --git a/metabase/client.gen.go b/metabase/client.gen.go
index ab5de71..0cc93ba 100644
--- a/metabase/client.gen.go
+++ b/metabase/client.gen.go
@@ -1,6 +1,6 @@
// Package metabase provides primitives to interact with the openapi HTTP API.
//
-// Code generated by github.com/deepmap/oapi-codegen version v1.16.2 DO NOT EDIT.
+// Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
package metabase
import (
@@ -42,9 +42,9 @@ const (
// Defines values for DatabaseDetailsBigQueryDatasetFiltersType.
const (
- DatabaseDetailsBigQueryDatasetFiltersTypeAll DatabaseDetailsBigQueryDatasetFiltersType = "all"
- DatabaseDetailsBigQueryDatasetFiltersTypeExclusion DatabaseDetailsBigQueryDatasetFiltersType = "exclusion"
- DatabaseDetailsBigQueryDatasetFiltersTypeInclusion DatabaseDetailsBigQueryDatasetFiltersType = "inclusion"
+ All DatabaseDetailsBigQueryDatasetFiltersType = "all"
+ Exclusion DatabaseDetailsBigQueryDatasetFiltersType = "exclusion"
+ Inclusion DatabaseDetailsBigQueryDatasetFiltersType = "inclusion"
)
// Defines values for DatabaseEngine.
@@ -52,13 +52,6 @@ const (
BigqueryCloudSdk DatabaseEngine = "bigquery-cloud-sdk"
)
-// Defines values for PermissionsGraphDatabaseAccessNative.
-const (
- PermissionsGraphDatabaseAccessNativeFull PermissionsGraphDatabaseAccessNative = "full"
- PermissionsGraphDatabaseAccessNativeNone PermissionsGraphDatabaseAccessNative = "none"
- PermissionsGraphDatabaseAccessNativeWrite PermissionsGraphDatabaseAccessNative = "write"
-)
-
// Defines values for PermissionsGraphDatabaseAccessSchemas0.
const (
PermissionsGraphDatabaseAccessSchemas0All PermissionsGraphDatabaseAccessSchemas0 = "all"
@@ -66,10 +59,26 @@ const (
PermissionsGraphDatabaseAccessSchemas0None PermissionsGraphDatabaseAccessSchemas0 = "none"
)
+// Defines values for PermissionsGraphDatabasePermissionsCreateQueries.
+const (
+ PermissionsGraphDatabasePermissionsCreateQueriesNo PermissionsGraphDatabasePermissionsCreateQueries = "no"
+ PermissionsGraphDatabasePermissionsCreateQueriesQueryBuilder PermissionsGraphDatabasePermissionsCreateQueries = "query-builder"
+ PermissionsGraphDatabasePermissionsCreateQueriesQueryBuilderAndNative PermissionsGraphDatabasePermissionsCreateQueries = "query-builder-and-native"
+)
+
// Defines values for PermissionsGraphDatabasePermissionsDetails.
const (
- No PermissionsGraphDatabasePermissionsDetails = "no"
- Yes PermissionsGraphDatabasePermissionsDetails = "yes"
+ PermissionsGraphDatabasePermissionsDetailsNo PermissionsGraphDatabasePermissionsDetails = "no"
+ PermissionsGraphDatabasePermissionsDetailsYes PermissionsGraphDatabasePermissionsDetails = "yes"
+)
+
+// Defines values for PermissionsGraphDatabasePermissionsViewData.
+const (
+ Blocked PermissionsGraphDatabasePermissionsViewData = "blocked"
+ Impersonated PermissionsGraphDatabasePermissionsViewData = "impersonated"
+ LegacyNoSelfService PermissionsGraphDatabasePermissionsViewData = "legacy-no-self-service"
+ No PermissionsGraphDatabasePermissionsViewData = "no"
+ Unrestricted PermissionsGraphDatabasePermissionsViewData = "unrestricted"
)
// Defines values for ListDatabasesParamsInclude.
@@ -435,14 +444,9 @@ type PermissionsGraph struct {
// PermissionsGraphDatabaseAccess The permissions for a single access type.
type PermissionsGraphDatabaseAccess struct {
- // Native Whether "Native query editing" is allowed.
- Native *PermissionsGraphDatabaseAccessNative `json:"native,omitempty"`
Schemas *PermissionsGraphDatabaseAccess_Schemas `json:"schemas,omitempty"`
}
-// PermissionsGraphDatabaseAccessNative Whether "Native query editing" is allowed.
-type PermissionsGraphDatabaseAccessNative string
-
// PermissionsGraphDatabaseAccessSchemas0 Whether "Data access" is allowed.
type PermissionsGraphDatabaseAccessSchemas0 string
@@ -453,8 +457,8 @@ type PermissionsGraphDatabaseAccess_Schemas struct {
// PermissionsGraphDatabasePermissions The permissions related to a single database.
type PermissionsGraphDatabasePermissions struct {
- // Data The permissions for a single access type.
- Data *PermissionsGraphDatabaseAccess `json:"data,omitempty"`
+ // CreateQueries The permission definition for creating queries.
+ CreateQueries *PermissionsGraphDatabasePermissionsCreateQueries `json:"create-queries,omitempty"`
// DataModel The permissions for a single access type.
DataModel *PermissionsGraphDatabaseAccess `json:"data-model,omitempty"`
@@ -464,11 +468,20 @@ type PermissionsGraphDatabasePermissions struct {
// Download The permissions for a single access type.
Download *PermissionsGraphDatabaseAccess `json:"download,omitempty"`
+
+ // ViewData The permission definition for viewing data.
+ ViewData PermissionsGraphDatabasePermissionsViewData `json:"view-data"`
}
+// PermissionsGraphDatabasePermissionsCreateQueries The permission definition for creating queries.
+type PermissionsGraphDatabasePermissionsCreateQueries string
+
// PermissionsGraphDatabasePermissionsDetails The permission definition for accessing details.
type PermissionsGraphDatabasePermissionsDetails string
+// PermissionsGraphDatabasePermissionsViewData The permission definition for viewing data.
+type PermissionsGraphDatabasePermissionsViewData string
+
// PermissionsGraphDatabasePermissionsMap A map where keys are database IDs and values are permissions related to the database.
type PermissionsGraphDatabasePermissionsMap map[string]PermissionsGraphDatabasePermissions
diff --git a/test-docker.sh b/test-docker.sh
index c9d36fc..5e6db97 100755
--- a/test-docker.sh
+++ b/test-docker.sh
@@ -7,7 +7,7 @@ DOCKER_NETWORK=terraform-metabase
METABASE_IMAGE=${METABASE_IMAGE:=metabase/metabase}
METABASE_CONTAINER_NAME=terraform-metabase-mb
-METABASE_VERSION=${METABASE_VERSION:=v0.49.25}
+METABASE_VERSION=${METABASE_VERSION:=v0.50.24.4}
METABASE_PORT=${METABASE_PORT:=3000}
METABASE_USERNAME=${METABASE_USERNAME:=terraform-provider@tests.com}
METABASE_PASSWORD=${METABASE_PASSWORD:=$(uuidgen)}