Skip to content

Commit f311f67

Browse files
committed
Wire baton ID into database grants
1 parent 903fc1b commit f311f67

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/connector/database.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,20 @@ func (d *databaseSyncer) Grants(ctx context.Context, resource *v2.Resource, pTok
143143
return nil, "", nil, fmt.Errorf("unexpected resource type: %s", rt.Id)
144144
}
145145

146+
grantOpts, err := BuildBatonIDGrantOptions(resourceID, p.PrincipalType, p.PrincipalName)
147+
if err != nil {
148+
return nil, "", nil, err
149+
}
150+
146151
switch p.State {
147152
case "G":
148153
ret = append(ret, grTypes.NewGrant(resource, perm, &v2.Resource{
149154
Id: resourceID,
150-
}))
155+
}, grantOpts...))
151156
case "W":
152157
ret = append(ret, grTypes.NewGrant(resource, perm+"-grant", &v2.Resource{
153158
Id: resourceID,
154-
}))
159+
}, grantOpts...))
155160
}
156161
}
157162
}

0 commit comments

Comments
 (0)