File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,18 +12,29 @@ begin
1212 end if;
1313 end loop;
1414 end if;
15+
16+ with
17+ x as (
18+ select ' ' as remove from dual
19+ union all
20+ select ' ANY' as remove from dual
21+ )
1522 select listagg(' - ' || privilege,CHR(10 )) within group(order by privilege)
16- into l_missing_grants
17- from (
18- select column_value as privilege
19- from table(l_expected_grants)
20- minus
21- (select privilege
22- from user_sys_privs
23- union all
24- select replace(privilege,' ANY' ) privilege
25- from user_sys_privs)
26- );
23+ into l_missing_grants
24+ from (
25+ select column_value as privilege
26+ from table(l_expected_grants)
27+ minus (
28+ select replace(p .privilege , x .remove ) as privilege
29+ from role_sys_privs p
30+ join session_roles r using (role)
31+ cross join x
32+ union all
33+ select replace(p .privilege , x .remove ) as privilege
34+ from user_sys_privs p
35+ cross join x
36+ )
37+ );
2738 if l_missing_grants is not null then
2839 raise_application_error(
2940 - 20000
You can’t perform that action at this time.
0 commit comments