Getting the username from cdb_conf
This commit is contained in:
parent
d5864ccada
commit
4d3e9f2b32
@ -25,16 +25,11 @@ BEGIN
|
|||||||
IF is_organization IS NULL THEN
|
IF is_organization IS NULL THEN
|
||||||
RAISE EXCEPTION 'User must have user configuration in the config table';
|
RAISE EXCEPTION 'User must have user configuration in the config table';
|
||||||
ELSIF is_organization = TRUE THEN
|
ELSIF is_organization = TRUE THEN
|
||||||
SELECT nspname
|
|
||||||
FROM pg_namespace s
|
|
||||||
LEFT JOIN pg_roles r ON s.nspowner = r.oid
|
|
||||||
WHERE r.rolname = session_user INTO username;
|
|
||||||
SELECT cartodb.cdb_conf_getconf('user_config')->>'entity_name' INTO organization_name;
|
SELECT cartodb.cdb_conf_getconf('user_config')->>'entity_name' INTO organization_name;
|
||||||
ELSE
|
ELSE
|
||||||
SELECT cartodb.cdb_conf_getconf('user_config')->>'entity_name' INTO username;
|
|
||||||
organization_name = NULL;
|
organization_name = NULL;
|
||||||
END IF;
|
END IF;
|
||||||
result.username = username;
|
result.username = apikey_config->'username';
|
||||||
result.organization_name = organization_name;
|
result.organization_name = organization_name;
|
||||||
result.apikey_permissions = apikey_config->'permissions';
|
result.apikey_permissions = apikey_config->'permissions';
|
||||||
RETURN result;
|
RETURN result;
|
||||||
|
Loading…
Reference in New Issue
Block a user