Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Sarah Funkhouser <[email protected]>
  • Loading branch information
golanglemonade committed Feb 5, 2025
1 parent b52c5a6 commit 71554e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions internal/ent/hooks/objectownedtuples.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,10 @@ func HookRelationTuples(objects map[string]string, relation fgax.Relation) ent.H
// using the tuple structs that are about to be written
func checkAccessToObjectsFromTuples(ctx context.Context, m ent.Mutation, tuples []fgax.TupleKey) error {
for _, tuple := range tuples {
objectID := tuple.Object.Identifier
objectType := string(tuple.Object.Kind)
// subject is the group that the permissions are being added to
// this is the reverse edge
objectID := tuple.Subject.Identifier
objectType := string(tuple.Subject.Kind)

if _, allow := privacy.DecisionFromContext(ctx); allow {
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/graphapi/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (suite *GraphTestSuite) TestMutationCreateControl() {
{
name: "add groups",
request: openlaneclient.CreateControlInput{
Name: "Test Procedure",
Name: "Test Control CC1.2",
EditorIDs: []string{testUser1.GroupID},
BlockedGroupIDs: []string{blockedGroup.ID},
ViewerIDs: []string{viewerGroup.ID},
Expand Down

0 comments on commit 71554e4

Please sign in to comment.