Added an option for optimization of wildcard grants to individual grants. The default behavior now checks first for specific grants to a database the wildcard grants.

This commit is contained in:
Markus Makela
2015-04-15 06:51:52 +03:00
parent 786f34cf49
commit d16e4fe134
5 changed files with 62 additions and 7 deletions

View File

@ -970,7 +970,7 @@ getAllUsers(SERVICE *service, USERS *users)
}
}
if(havedb && wildcard_db_grant(dbnm))
if(service->optimize_wildcard && havedb && wildcard_db_grant(dbnm))
{
rc = add_wildcard_users(users, row[0], row[1], password, row[4], dbnm, service->resources);
skygw_log_write(LOGFILE_DEBUG|LOGFILE_TRACE,"%s: Converted '%s' to %d individual database grants.",service->name,dbnm,rc);
@ -1454,7 +1454,7 @@ getUsers(SERVICE *service, USERS *users)
if (db_grants) {
/* we have dbgrants, store them */
if(wildcard_db_grant(row[5]))
if(service->optimize_wildcard && wildcard_db_grant(row[5]))
{
rc = add_wildcard_users(users, row[0], row[1], password, row[4], row[5], service->resources);
skygw_log_write(LOGFILE_DEBUG|LOGFILE_TRACE,"%s: Converted '%s' to %d individual database grants.",service->name,row[5],rc);