8000 Improvements to privilege handling in utPLSQL by jgebal · Pull Request #1056 · utPLSQL/utPLSQL · GitHub
[go: up one dir, main page]

Skip to content

Improvements to privilege handling in utPLSQL #1056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 14, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added check for sys grants added via role when installing utPLSQL fra…
…mework.

Resolves #1050
  • Loading branch information
jgebal committed Mar 12, 2020
commit 4979cf924df78137e31d40f8d24cff1cb8191776
33 changes: 22 additions & 11 deletions source/check_sys_grants.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,29 @@ begin
end if;
end loop;
end if;

with
x as (
select '' as remove from dual
union all
select ' ANY' as remove from dual
)
select listagg(' - '||privilege,CHR(10)) within group(order by privilege)
into l_missing_grants
from (
select column_value as privilege
from table(l_expected_grants)
minus
(select privilege
from user_sys_privs
union all
select replace(privilege,' ANY') privilege
from user_sys_privs)
);
into l_missing_grants
from (
select column_value as privilege
from table(l_expected_grants)
minus (
select replace(p.privilege, x.remove) as privilege
from role_sys_privs p
join session_roles r using (role)
cross join x
union all
select replace(p.privilege, x.remove) as privilege
from user_sys_privs p
cross join x
)
);
if l_missing_grants is not null then
raise_application_error(
-20000
Expand Down
0