Commit 3e22092
Support Same-DB Ownership Chaining for object references inside Procedure/Functions (babelfish-for-postgresql#616)
This commit implements the ownership chaining support for object
references inside function/procedure. The basic idea of Ownership chaining is that when
one object references another, and both have the same owner, then permissions
are only checked when the top-level object is accessed.
Core Functionality:
Added support for ownership chaining within the same database for procedures and functions
Key Components Modified:
Added ownership chain validation in permission checks
Walker function to mark relations and functions inside view definitions
Implementation:
Walker function to mark relations and functions inside view definitions
Walks through the query parse tree to:
Mark relations and functions as being inside a view context
For relations:
Set checkAsUser to the view_owner when it matches the relation's owner,
enabling permission checking to pass at the executor stage (ownership chaining)
For procedures/functions:
Store the view_owner in the parentOwnerId field to support
procedure/function-specific ownership chaining logic
during permission checks at the executor stage
Extension PR : babelfish-for-postgresql/babelfish_extensions#4057
Task: BABEL-6030
Signed-off-by: Harsh Lunagariya <lunharsh@amazon.com>
Co-authored-by: pranav jain <pranav23iitd@gmail.com>1 parent 203b537 commit 3e22092
File tree
4 files changed
+4
-4
lines changed- src
- backend
- commands
- executor
- include/executor
4 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2362 | 2362 | | |
2363 | 2363 | | |
2364 | 2364 | | |
2365 | | - | |
| 2365 | + | |
2366 | 2366 | | |
2367 | 2367 | | |
2368 | 2368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2639 | 2639 | | |
2640 | 2640 | | |
2641 | 2641 | | |
2642 | | - | |
| 2642 | + | |
2643 | 2643 | | |
2644 | 2644 | | |
2645 | 2645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments