Skip to content

Commit

Permalink
Rename GroupId to GroupID in struct
Browse files Browse the repository at this point in the history
  • Loading branch information
emeric-martineau committed Aug 2, 2023
1 parent 55fcf74 commit fdc6315
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions metabase/table_metabase_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

type Permission struct {
GroupId int
GroupID int
DbId int
DownloadNative *string
DownloadSchema *string
Expand All @@ -28,8 +28,7 @@ func tableMetabasePermission() *plugin.Table {
Hydrate: listPermission,
},
Columns: []*plugin.Column{
// Key column cannot be a pointer. Transform helps us to manage them
{Name: "group_id", Type: proto.ColumnType_INT, Transform: transform.FromField("GroupId"), Description: "ID of the group."},
{Name: "group_id", Type: proto.ColumnType_INT, Description: "ID of the group."},
{Name: "db_id", Type: proto.ColumnType_INT, Transform: transform.FromField("DbId"), Description: "ID of the database."},
{Name: "download_native", Type: proto.ColumnType_STRING, Transform: transform.FromField("DownloadNative"), Description: "Type of download."},
{Name: "download_schema", Type: proto.ColumnType_STRING, Transform: transform.FromField("DownloadSchema"), Description: "Schema that you can download."},
Expand Down Expand Up @@ -103,7 +102,7 @@ func createPermission(methodCallStack string, ctx context.Context, groups *map[s
dataNative, dataSchema := extractNativeAndSchemas(data.Data)

permissions = append(permissions, Permission{
GroupId: gId,
GroupID: gId,
DbId: dId,
DownloadNative: downloadNative,
DownloadSchema: downloadSchema,
Expand Down
7 changes: 3 additions & 4 deletions metabase/table_metabase_permission_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ const (
)

var SubPermissionColum = []*plugin.Column{
// Key column cannot be a pointer. Transform helps us to manage them
{Name: "group_id", Type: proto.ColumnType_INT, Transform: transform.FromField("GroupId"), Description: "ID of the group."},
{Name: "group_id", Type: proto.ColumnType_INT, Description: "ID of the group."},
{Name: "db_id", Type: proto.ColumnType_INT, Transform: transform.FromField("DbId"), Description: "ID of the database."},
{Name: "schema_name", Type: proto.ColumnType_STRING, Transform: transform.FromField("SchemaName"), Description: "Name of schema."},
{Name: "table_id", Type: proto.ColumnType_INT, Transform: transform.FromField("TableId"), Description: "Table id."},
{Name: "level_access", Type: proto.ColumnType_STRING, Transform: transform.FromField("LevelAccess"), Description: "Level access of table."},
}

type PermissionSchema struct {
GroupId int
GroupID int
DbId int
SchemaName string
TableId int
Expand Down Expand Up @@ -201,7 +200,7 @@ func extractGranularPermissions(methodCallStack string, ctx context.Context, gro
}

permissions = append(permissions, PermissionSchema{
GroupId: groupId,
GroupID: groupId,
DbId: dbId,
SchemaName: schemaName,
TableId: tId,
Expand Down

0 comments on commit fdc6315

Please sign in to comment.