Skip to content

Commit

Permalink
Return/log errors, fix comments, remove raw edges from ACLRelationshi…
Browse files Browse the repository at this point in the history
…ps to address PR comments
  • Loading branch information
Mayyhem committed Dec 12, 2024
1 parent d262e0c commit 2b464aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 1 addition & 3 deletions packages/cue/bh/ad/ad.cue
Original file line number Diff line number Diff line change
Expand Up @@ -1465,9 +1465,7 @@ ACLRelationships: [
WritePKIEnrollmentFlag,
WritePKINameFlag,
WriteOwnerLimitedRights,
OwnsLimitedRights,
OwnsRaw,
WriteOwnerRaw
OwnsLimitedRights
]

// Edges that are used in pathfinding
Expand Down
9 changes: 6 additions & 3 deletions packages/go/analysis/ad/owns.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func PostOwnsAndWriteOwner(ctx context.Context, db graph.Database, groupExpansio
dsHeuristicsCache, anyEnforced, err := GetDsHeuristicsCache(ctx, db)
if err != nil {
log.Errorf("failed fetching dsheuristics values for postownsandwriteowner: %w", err)
return nil, err
}

adminGroupIds, err := FetchAdminGroupIds(ctx, db, groupExpansions)
Expand All @@ -61,10 +62,11 @@ func PostOwnsAndWriteOwner(ctx context.Context, db graph.Database, groupExpansio

// Get the target node of the OwnsRaw relationship
if targetNode, err := ops.FetchNode(tx, rel.EndID); err != nil {
log.Errorf("failed fetching OwnsRaw target node postownsandwriteowner: %w", err)
continue

} else if domainSid, err := targetNode.Properties.GetOrDefault(ad.DomainSID.String(), "").String(); err != nil {
// Get the dSHeuristics value for the domain of the target node
// Get the domain SID of the target node
continue
} else {
enforced, ok := dsHeuristicsCache[domainSid]
Expand Down Expand Up @@ -135,12 +137,13 @@ func PostOwnsAndWriteOwner(ctx context.Context, db graph.Database, groupExpansio
// Check if ANY domain enforces BlockOwnerImplicitRights (dSHeuristics[28] == 1)
if anyEnforced {

// Get the target node of the WriteOwner relationship
// Get the target node of the WriteOwnerRaw relationship
if targetNode, err := ops.FetchNode(tx, rel.EndID); err != nil {
log.Errorf("failed fetching WriteOwnerRaw target node postownsandwriteowner: %w", err)
continue

} else if domainSid, err := targetNode.Properties.GetOrDefault(ad.DomainSID.String(), "").String(); err != nil {
// Get the dSHeuristics value for the domain of the target node
// Get the domain SID of the target node
continue
} else {
enforced, ok := dsHeuristicsCache[domainSid]
Expand Down
2 changes: 1 addition & 1 deletion packages/go/graphschema/ad/ad.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b464aa

Please sign in to comment.