MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / isRoleGranted

Method isRoleGranted

src/jrd/Mapping.cpp:1192–1213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1190 { }
1191
1192 bool isRoleGranted(const string& name, const string* role, bool& granted)
1193 {
1194 if (!(name.hasData() && role))
1195 {
1196 granted = false;
1197 return true;
1198 }
1199
1200 string* r = get(name);
1201 if (!r)
1202 return false;
1203
1204 string zRole;
1205 zRole += ROLESEP;
1206 zRole += *role;
1207 zRole += ROLESEP;
1208
1209 MAP_DEBUG(fprintf(stderr, "isRoleGranted '%s' '%s'\n", r->c_str(), role->c_str()));
1210
1211 granted = r->find(zRole) != string::npos;
1212 return true;
1213 }
1214
1215 void populate(const string& name, const string* /*role*/, Mapping::DbHandle& iDb)
1216 {

Callers 1

getPrivilegesMethod · 0.80

Calls 4

getFunction · 0.50
hasDataMethod · 0.45
c_strMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected