Skip to content

Commit

Permalink
don't call set permissions on shared folder
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnester committed Oct 30, 2024
1 parent 489e98d commit 94ea143
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions bundle/config/validate/folder_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (f *folderPermissions) Apply(ctx context.Context, b bundle.ReadOnlyBundle)
}

func checkFolderPermission(ctx context.Context, b bundle.ReadOnlyBundle, folderPath string) diag.Diagnostics {
// If the folder is shared, then we don't need to check permissions as it was already checked in the other mutator before.
if libraries.IsWorkspaceSharedPath(folderPath) {
return nil
}
Expand Down
6 changes: 6 additions & 0 deletions bundle/permissions/workspace_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/databricks/cli/bundle"
"github.com/databricks/cli/bundle/libraries"
"github.com/databricks/cli/bundle/paths"
"github.com/databricks/cli/libs/diag"
"github.com/databricks/databricks-sdk-go/service/workspace"
Expand Down Expand Up @@ -67,6 +68,11 @@ func giveAccessForWorkspaceRoot(ctx context.Context, b *bundle.Bundle) error {
}

func setPermissions(ctx context.Context, w workspace.WorkspaceInterface, path string, permissions []workspace.WorkspaceObjectAccessControlRequest) error {
// If the folder is shared, then we don't need to set it's as it was already checked in the other mutator before.
if libraries.IsWorkspaceSharedPath(path) {
return nil
}

obj, err := w.GetStatusByPath(ctx, path)
if err != nil {
return err
Expand Down

0 comments on commit 94ea143

Please sign in to comment.