Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/mssqldb/databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ func (c *Client) RevokePermissionOnDatabase(ctx context.Context, permission, db,
}

command := fmt.Sprintf(
"GRANT %s ON DATABASE::[%s] TO [%s];",
"REVOKE %s ON DATABASE::[%s] FROM [%s];",
fullPermission,
db,
user,
)

_, err := c.db.ExecContext(ctx, command, fullPermission, db, user)
_, err := c.db.ExecContext(ctx, command)
if err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: The sibling GrantPermissionOnDatabase (line ~126) still passes inert positional args permission, db, user to ExecContext — the same pattern cleaned up here. Consider removing them there too for consistency.

Suggested change
if err != nil {
_, err := c.db.ExecContext(ctx, command)

return err
}
Expand Down
Loading