1 PACKAGE driacc AS
2 --
3 -- NAME
4 -- split_spec - parse a spec into distinct parts
5 --
6 -- DESCRIPTION
7 -- This procedure takes an object spec and splits it into parts
8 --
9 -- ARGUMENTS
10 -- p_spec (IN) - the spec
11 -- p_type (IN) - COL, TABLE, POLICY, or PROC
12 -- p_owner (OUT) - the owner name
13 -- p_object (OUT) - the object or package name
14 -- p_function (OUT) - the function name
15 -- p_link (OUT) - the db link name
16 --
17 -- NOTES
18 --
19 -- RETURN
20 --
21 PROCEDURE split_spec (
22 p_spec IN VARCHAR2,
23 p_type IN VARCHAR2,
24 p_owner IN OUT VARCHAR2,
25 p_object IN OUT VARCHAR2,
26 p_function IN OUT VARCHAR2,
27 p_link IN OUT VARCHAR2
28 );
29 --
30 --
31 -- NAME
32 -- can - test whether user can access an object
33 --
34 -- DESCRIPTION
35 -- This function tests whether a user can access an object.
36 -- if the spec passed in is a synonym reference, will also
37 -- transform the spec to the base object.
38 --
39 -- ARGUMENTS
40 -- p_user (IN) - the user name
41 -- p_access (IN) - what kind of access (SELECT/EXECUTE/INSERT)
42 -- p_spec (IN OUT) - spec of object
43 --
44 -- NOTES
45 --
46 -- RETURN
47 -- true if can access, false otherwise.
48 --
49 FUNCTION can (
50 p_user IN VARCHAR2,
51 p_access IN VARCHAR2,
52 p_spec IN OUT VARCHAR2
53 ) RETURN BOOLEAN;
54 --
55 --
56 -- NAME
57 -- can_execute - test whether user can execute a function/procedure
58 --
59 -- DESCRIPTION
60 -- This function tests whether a user can execute a function/procedure.
61 -- if the spec passed in is a synonym reference, will also
62 -- transform the spec to the base object.
63 --
64 -- ARGUMENTS
65 -- p_user (IN) - the user name
66 -- p_spec (IN) - spec of object
67 --
68 -- NOTES
69 --
70 -- RETURN
71 -- fully qualified name if can access, empty string otherwise.
72 --
73 FUNCTION can_execute (
74 p_user IN VARCHAR2,
75 p_spec IN VARCHAR2
76 ) RETURN VARCHAR2;
77 --
78 --
79 -- NAME
80 -- verify_colspec - verify a column spec
81 --
82 -- DESCRIPTION
83 -- This function takes a column spec, synonym-reduces, then
84 -- verifies that the column exists.
85 --
86 -- ARGUMENTS
87 -- p_colspec (IN) - the column spec
88 -- p_owner (OUT) - the owner
89 -- p_table (OUT) - the table name
90 -- p_column (OUT) - the column name
91 -- p_dblink (OUT) - the database link name
92 --
93 -- NOTES
94 --
95 -- RETURN
96 -- true if everything checks out, false otherwise.
97 --
98 FUNCTION verify_colspec (
99 p_colspec IN VARCHAR2,
100 p_owner IN OUT VARCHAR2,
101 p_table IN OUT VARCHAR2,
102 p_column IN OUT VARCHAR2,
103 p_link IN OUT VARCHAR2
104 ) RETURN BOOLEAN;
105 --
106 --
107 -- NAME
108 -- verify_procedure - verify a procedure
109 --
110 -- DESCRIPTION
111 -- This function takes package.procedure_name or procedure_name
112 -- verifies that it exists and that ctxsys owns the package/procedure
113 -- this is called from the user datastore validation
114 --
115 -- ARGUMENTS
116 -- p_spec (IN) - package.procedure or procedure name
117 --
118 -- NOTES
119 --
120 -- RETURN
121 -- true if everything checks out, false otherwise.
122 --
123 FUNCTION verify_procedure (
124 p_spec IN OUT VARCHAR2
125 ) RETURN BOOLEAN;
126 --
127 --
128 --
129 -- NAME
130 -- user_in_role - does a user have a specific role?
131 --
132 -- DESCRIPTION
133 -- This function takes a user name and a role name and
134 -- returns true if the user has that role
135 --
136 -- ARGUMENTS
137 -- p_user (IN) - the user
138 -- p_role (IN) - the role name
139 --
140 -- NOTES
141 --
142 -- RETURN
143 -- true if everything checks out, false otherwise.
144 --
145 FUNCTION user_in_role (
146 p_user IN VARCHAR2,
147 p_role IN VARCHAR2
148 ) RETURN BOOLEAN;
149
150
151 --
152 -- NAME
153 -- ud_access
154 --
155 -- DESCRIPTION
156 -- This function takes the index owner name and ensures that the
157 -- index owner can execute the user datastore procedure. It is called
158 -- from set_store_objects
159 --
160 -- ARGUMENTS
161 -- p_user (IN) - the index owner
162 -- p_spec (IN) - the user datastore procedure name
163 --
164 -- NOTES
165 -- normally, would just be able to use CAN, but in this case
166 -- if the user datastore has just PROCEDURE, then a user with
167 -- package CTXSYS and procedure PROCEDURE would be able to fool CAN
168 --
169 -- RETURN
170 -- true if everything checks out, false otherwise.
171 --
172 FUNCTION ud_access (
173 p_user IN VARCHAR2,
174 p_spec IN VARCHAR2
175 ) RETURN BOOLEAN;
176
177 FUNCTION user_access (
178 p_user IN VARCHAR2,
179 p_access IN VARCHAR2,
180 p_owner IN VARCHAR2,
181 p_object IN VARCHAR2
182 ) RETURN BOOLEAN;
183
184
185 END driacc;