mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-25 07:21:45 -07:00
Avoid pointless revocations when ALL are granted
This commit is contained in:
parent
4c8a985997
commit
2ed72a53da
1 changed files with 5 additions and 1 deletions
|
@ -363,7 +363,11 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
|
|||
grant_privs = list(set(new_priv[db_table]) - set(curr_priv[db_table]))
|
||||
revoke_privs = list(set(curr_priv[db_table]) - set(new_priv[db_table]))
|
||||
|
||||
# ... but only revoke grant option if it exists and absence is requested
|
||||
# ... avoiding pointless revocations when ALL are granted
|
||||
if 'ALL' in grant_privs or 'ALL PRIVILEGES' in grant_privs:
|
||||
revoke_privs = list({'GRANT', 'PROXY'} & set(revoke_privs))
|
||||
|
||||
# Only revoke grant option if it exists and absence is requested
|
||||
#
|
||||
# For more details
|
||||
# https://github.com/ansible-collections/community.mysql/issues/77#issuecomment-1209693807
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue