Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: branch check protection rules (#10609)

p0ny048a3ba6fbd9
diff --git a/backend/api/v1/branch_service.go b/backend/api/v1/branch_service.go
index 89306d3c20..12a97e6cdf 100644
--- a/backend/api/v1/branch_service.go
+++ b/backend/api/v1/branch_service.go
@@ -826,7 +826,7 @@ func (s *BranchService) checkBranchPermission(ctx context.Context, projectID str
}
func (s *BranchService) checkProtectionRules(ctx context.Context, project *store.ProjectMessage, branchID string, user *store.UserMessage) error {
- if project.Setting == nil {
+ if len(project.Setting.GetProtectionRules()) == 0 {
return nil
}
// Skip protection check for workspace owner and DBA.