Team,
Reading through the "accessible by" clause enhancements in 12.2
http://docs.oracle.com/database/122/LNPLS/release-changes.htm#GUID-85A17D6B-4E7A-49D9-B5AC-B0D69390B449 <quote>
Starting with Oracle Database 12c release 2 (12.2), the accessor list can be defined on individual subprograms in a package. This list is checked in addition to the accessor list defined on the package itself (if any). This list may only restrict access to the subprogram – it cannot expand acces
</quote>
demo@ORA12C> create or replace package mypkg
2 as
3 function f return number accessible by (p1);
4 procedure p2;
5 end;
6 /
Package created.
demo@ORA12C> create or replace package body mypkg
2 as
3 function f return number
4 accessible by (p1)
5 as
6 begin
7 return 55;
8 end ;
9
10 procedure p2 as
11 begin
12 dbms_output.put_line('Result = '||mypkg.f);
13 end;
14 end;
15 /
Package body created.
demo@ORA12C> exec dbms_output.put_line( mypkg.f );
BEGIN dbms_output.put_line( mypkg.f ); END;
*
ERROR at line 1:
ORA-06550: line 1, column 35:
PLS-00904: insufficient privilege to access object F
demo@ORA12C> exec mypkg.p2 ;
Result = 55
PL/SQL procedure successfully completed.
The access list for the function F in the package is defined only for P1, but it is still accessible by another method "P2" from the same package, is this an expected behavior? please confirm.