mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-30 12:33:52 -06:00
Allow debugging of functions in packages. Fixes #1948
This commit is contained in:
parent
070a9c077e
commit
5c7dcaba81
@ -291,7 +291,8 @@ class EdbFuncView(PGChildNodeView, DataTypeReader):
|
||||
row['oid'],
|
||||
pkgid,
|
||||
row['name'],
|
||||
icon="icon-" + self.node_type
|
||||
icon="icon-" + self.node_type,
|
||||
funcowner=row['funcowner']
|
||||
),
|
||||
status=200
|
||||
)
|
||||
@ -302,7 +303,8 @@ class EdbFuncView(PGChildNodeView, DataTypeReader):
|
||||
row['oid'],
|
||||
pkgid,
|
||||
row['name'],
|
||||
icon="icon-" + self.node_type
|
||||
icon="icon-" + self.node_type,
|
||||
funcowner=row['funcowner']
|
||||
))
|
||||
|
||||
return make_json_response(
|
||||
|
@ -1,5 +1,6 @@
|
||||
SELECT pg_proc.oid,
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
|
||||
pg_get_userbyid(proowner) AS funcowner
|
||||
FROM pg_proc, pg_namespace
|
||||
WHERE format_type(prorettype, NULL) != 'void'
|
||||
{% if fnid %}
|
||||
|
@ -1,5 +1,6 @@
|
||||
SELECT pg_proc.oid,
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
|
||||
pg_get_userbyid(proowner) AS funcowner
|
||||
FROM pg_proc, pg_namespace
|
||||
WHERE format_type(prorettype, NULL) != 'void'
|
||||
{% if fnid %}
|
||||
|
@ -1,5 +1,6 @@
|
||||
SELECT pg_proc.oid,
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
|
||||
pg_get_userbyid(proowner) AS funcowner
|
||||
FROM pg_proc, pg_namespace
|
||||
WHERE format_type(prorettype, NULL) = 'void'
|
||||
{% if fnid %}
|
||||
|
@ -1,5 +1,6 @@
|
||||
SELECT pg_proc.oid,
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name
|
||||
pg_proc.proname || '(' || COALESCE(pg_catalog.pg_get_function_identity_arguments(pg_proc.oid), '') || ')' AS name,
|
||||
pg_get_userbyid(proowner) AS funcowner
|
||||
FROM pg_proc, pg_namespace
|
||||
WHERE format_type(prorettype, NULL) = 'void'
|
||||
{% if fnid %}
|
||||
|
@ -126,8 +126,14 @@ define([
|
||||
&& !treeInfo.server.user.is_superuser)
|
||||
return false;
|
||||
|
||||
// Fetch object owner
|
||||
var obj_owner = treeInfo.function && treeInfo.function.funcowner ||
|
||||
treeInfo.procedure && treeInfo.procedure.funcowner ||
|
||||
treeInfo.edbfunc && treeInfo.edbfunc.funcowner ||
|
||||
treeInfo.edbproc && treeInfo.edbproc.funcowner;
|
||||
|
||||
// Must be a super user or object owner to create breakpoints of any kind
|
||||
if (!(treeInfo.server.user.is_superuser || treeInfo.function.funcowner == treeInfo.server.user.name))
|
||||
if (!(treeInfo.server.user.is_superuser || obj_owner == treeInfo.server.user.name))
|
||||
return false;
|
||||
|
||||
// For trigger node, language will be undefined - we should allow indirect debugging for trigger node
|
||||
|
Loading…
Reference in New Issue
Block a user