diff --git a/src/jrd/Mapping.cpp b/src/jrd/Mapping.cpp index 38eb60df61..ea8ea1d46b 100644 --- a/src/jrd/Mapping.cpp +++ b/src/jrd/Mapping.cpp @@ -1091,7 +1091,12 @@ private: return false; MAP_DEBUG(fprintf(stderr, "granted=%d\n", granted)); - return roles.getPrivileges((granted ? *sqlRole : trusted_role), system_privileges); + + // Note, roles have no special entry with empty string as a key. + // Thus, don't consider it as not populated if role to check is not set (empty). + + const string& roleInUse = granted ? *sqlRole : trusted_role; + return roleInUse.hasData() ? roles.getPrivileges(roleInUse, system_privileges) : true; } void populate(Mapping::DbHandle& iDb, const string& name, const string* sqlRole,