Skip to content

Commit aa65e24

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat-ISS-2254
2 parents 8cf7929 + 72ce5a2 commit aa65e24

9 files changed

Lines changed: 20 additions & 14 deletions

File tree

.task/checksum/generate-ent-smart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
48a08aa9181e9c47a9b9d5d35a7b7254
1+
1acbb24645ec24baa59407dd87401b26

common/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/rs/zerolog v1.35.1
1212
github.com/stoewer/go-strcase v1.3.1
1313
github.com/stretchr/testify v1.11.1
14-
github.com/theopenlane/core v1.21.22
14+
github.com/theopenlane/core v1.22.0
1515
github.com/theopenlane/echox v0.3.0
1616
github.com/theopenlane/entx v0.29.0
1717
github.com/theopenlane/utils v0.7.1
@@ -81,7 +81,6 @@ require (
8181
golang.org/x/crypto v0.52.0 // indirect
8282
golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect
8383
golang.org/x/mod v0.36.0 // indirect
84-
golang.org/x/net v0.55.0 // indirect
8584
golang.org/x/sync v0.20.0 // indirect
8685
golang.org/x/sys v0.45.0 // indirect
8786
golang.org/x/text v0.37.0 // indirect

common/go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
137137
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
138138
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
139139
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
140-
github.com/theopenlane/core v1.21.22 h1:OpCxR6QSJndAdcgSGFRivVmQIjGlmDc3ASmNtXgBJ74=
141-
github.com/theopenlane/core v1.21.22/go.mod h1:nbb9es/91Sr1foL4OBoB7oMphnsvG6Ppl8fChF9XlmI=
140+
github.com/theopenlane/core v1.22.0 h1:qK5+Kk/rDcDOXW8YHrs2xT8aw0FiZIMkqyQ8AcBAa5w=
141+
github.com/theopenlane/core v1.22.0/go.mod h1:SrNt9zfTeEupwkaBjtXbe+NeTueXdZO1sDarHDU5x8k=
142142
github.com/theopenlane/echox v0.3.0 h1:uwOKEw+r1utGQoOR6dZQqAVuY5j8TcasqnTwO5+rMsA=
143143
github.com/theopenlane/echox v0.3.0/go.mod h1:yTrXnj7s3VNIg0FCvB7Dut2Elr+LqJKU/nruxx1E1cM=
144144
github.com/theopenlane/entx v0.29.0 h1:KvpP78yuxk5p7NCjIZBFvgN5zIvSd/7tX4HQZbaxbZc=
145+
github.com/theopenlane/entx v0.29.0/go.mod h1:Lyp+YR7PCaye6B/QVTwHcGQ0cXgXLx2CeDgxsG8Do2Q=
145146
github.com/theopenlane/utils v0.7.1 h1:x+9kVMgOALYqAH6GaLaDb9tj16nzasoGM8X0v0XNTn8=
146147
github.com/theopenlane/utils v0.7.1/go.mod h1:uxiLqjtcqgH57yOpYl3tTfKuenGYyAROxHFMpXx6mDY=
147148
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
@@ -178,12 +179,15 @@ github.com/zitadel/schema v1.3.2/go.mod h1:IZmdfF9Wu62Zu6tJJTH3UsArevs3Y4smfJIj3
178179
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
179180
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
180181
go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
182+
go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
181183
go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc=
184+
go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo=
182185
go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg=
183186
go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg=
184187
go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw=
185188
go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A=
186189
go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk=
190+
go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE=
187191
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
188192
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
189193
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2f992ebc8524c98209780beb4f9861d78b4a63126eb69a0fe0118916258c7ca7
1+
ca3ed96065b806134675a56e79bbb162e5abf2204f771ed629cab45486bd98f4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
59f26ded15c9dc3b4487c052b8401b850f5a8e82eb8019e47aeca02057aead8c
1+
2d602de5818b2dc3e7e54be1ed229e5de8d341e612625932ce4bf40c2a5e10b5

internal/ent/hooks/trustcenterndarequest.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func checkNDAApprover(ctx context.Context, m *generated.TrustCenterNDARequestMut
313313
return err
314314
}
315315

316-
approverIDs, err := ndaApproverUserIDs(ctx, m.Client(), tc.OwnerID, tc.Edges.Setting)
316+
approverIDs, err := getNDAApproverUserIDs(ctx, m.Client(), tc.OwnerID, tc.Edges.Setting)
317317
if err != nil {
318318
return err
319319
}
@@ -409,7 +409,7 @@ func sendNDAApprovalRequestEmails(ctx context.Context, client *generated.Client,
409409
return err
410410
}
411411

412-
emails, err := ndaApproverEmails(ctx, client, tc.OwnerID, tc.Edges.Setting)
412+
emails, err := getNDAApproverEmails(ctx, client, tc.OwnerID, tc.Edges.Setting)
413413
if err != nil {
414414
return err
415415
}
@@ -430,8 +430,8 @@ func sendNDAApprovalRequestEmails(ctx context.Context, client *generated.Client,
430430
})
431431
}
432432

433-
func ndaApproverEmails(ctx context.Context, client *generated.Client, ownerID string, setting *generated.TrustCenterSetting) ([]string, error) {
434-
ids, err := ndaApproverUserIDs(ctx, client, ownerID, setting)
433+
func getNDAApproverEmails(ctx context.Context, client *generated.Client, ownerID string, setting *generated.TrustCenterSetting) ([]string, error) {
434+
ids, err := getNDAApproverUserIDs(ctx, client, ownerID, setting)
435435
if err != nil {
436436
return nil, err
437437
}
@@ -457,7 +457,7 @@ func ndaApproverEmails(ctx context.Context, client *generated.Client, ownerID st
457457
})), nil
458458
}
459459

460-
func ndaApproverUserIDs(ctx context.Context, client *generated.Client, ownerID string, setting *generated.TrustCenterSetting) ([]string, error) {
460+
func getNDAApproverUserIDs(ctx context.Context, client *generated.Client, ownerID string, setting *generated.TrustCenterSetting) ([]string, error) {
461461
allowCtx := privacy.DecisionContext(ctx, privacy.Allow)
462462

463463
if setting != nil && setting.NdaApproverGroupID != nil && *setting.NdaApproverGroupID != "" {

internal/ent/privacy/rule/allow_comments.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"entgo.io/ent"
77

88
"github.com/samber/lo"
9+
910
"github.com/theopenlane/core/internal/ent/generated"
1011
"github.com/theopenlane/core/internal/ent/generated/privacy"
1112
"github.com/theopenlane/core/pkg/slateparser"
@@ -25,7 +26,7 @@ func CheckIfCommentOnly() privacy.MutationRuleFunc {
2526
addedFields := m.AddedFields() // get numeric fields
2627

2728
ignoreFields := []string{"updated_at", "updated_by", "owner_id"}
28-
allowedEdges := []string{"comments"}
29+
allowedEdges := []string{"comments", "notes"}
2930

3031
// remove ignored fields from the list of fields being set in the mutation
3132
fields = lo.Without(fields, ignoreFields...)

internal/ent/schema/entity.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/theopenlane/core/internal/ent/hooks"
2121
"github.com/theopenlane/core/internal/ent/mixin"
2222
"github.com/theopenlane/core/internal/ent/privacy/policy"
23+
"github.com/theopenlane/core/internal/ent/privacy/rule"
2324
"github.com/theopenlane/core/internal/ent/validator"
2425
)
2526

@@ -424,6 +425,7 @@ func (e Entity) Policy() ent.Policy {
424425
return policy.NewPolicy(
425426
policy.WithMutationRules(
426427
policy.CheckCreateAccess(),
428+
rule.CheckIfCommentOnly(),
427429
entfga.CheckEditAccess[*generated.EntityMutation](),
428430
),
429431
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c26dd893dff984a334fdbaf18b84a52705681daecb748d9c07f76069d9695415
1+
ec173927f9b343fbd198214ec1c05e05955125d236cf8fb4cf4a7a4aa3a80bab

0 commit comments

Comments
 (0)