Skip to content

Commit cff0165

Browse files
authored
Merge pull request #54 from huanjeff7/master
Add execution of SQL statement for adding original user roles to clon…
2 parents d44f988 + 03e12ca commit cff0165

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

SecretsManagerRDSSQLServerRotationMultiUser/lambda_function.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ def apply_database_permissions(cursor, current_user, pending_user):
500500
for row in cursor.fetchall():
501501
sql_stmt = "ALTER ROLE %s ADD MEMBER %s" % (row['name'], pending_user)
502502

503+
# Assign each role from the current user to the pending user
504+
cursor.execute(sql_stmt)
505+
503506
# Loop through the database permissions and grant them to the user
504507
query = "SELECT "\
505508
"class = perm.class, "\

0 commit comments

Comments
 (0)