|
| 1 | +/* |
| 2 | + utPLSQL - Version 3 |
| 3 | + Copyright 2016 - 2019 utPLSQL Project |
| 4 | +
|
| 5 | + Licensed under the Apache License, Version 2.0 (the "License"): |
| 6 | + you may not use this file except in compliance with the License. |
| 7 | + You may obtain a copy of the License at |
| 8 | +
|
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | + Unless required by applicable law or agreed to in writing, software |
| 12 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + See the License for the specific language governing permissions and |
| 15 | + limitations under the License. |
| 16 | +
|
| 17 | +Create all necessary grant for the user who owns test packages and want to execute utPLSQL framework |
| 18 | +*/ |
| 19 | + |
| 20 | +@@define_ut3_owner_param.sql |
| 21 | + |
| 22 | +column 2 new_value 2 noprint |
| 23 | +select null as "2" from dual where 1=0; |
| 24 | +spool params.sql.tmp |
| 25 | +select |
| 26 | + case |
| 27 | + when '&&2' is null then q'[ACCEPT ut3_user CHAR DEFAULT 'PUBLIC' PROMPT 'Provide schema which should be granted access to the utPLSQL v3 framework (PUBLIC): ']' |
| 28 | + else 'define ut3_user=&&2' |
| 29 | + end |
| 30 | +from dual; |
| 31 | + |
| 32 | +spool off |
| 33 | +set termout on |
| 34 | +@params.sql.tmp |
| 35 | +set termout off |
| 36 | +/* cleanup temporary sql files */ |
| 37 | +--try running on windows |
| 38 | +$ del params.sql.tmp |
| 39 | +--try running on linux/unix |
| 40 | +! rm params.sql.tmp |
| 41 | +set termout on |
| 42 | + |
| 43 | +set echo off |
| 44 | +set feedback on |
| 45 | +set heading off |
| 46 | +set verify off |
| 47 | + |
| 48 | +prompt Granting privileges on UTPLSQL objects in &&ut3_owner schema to user &&ut3_user |
| 49 | + |
| 50 | +whenever sqlerror exit failure rollback |
| 51 | +whenever oserror exit failure rollback |
| 52 | + |
| 53 | +alter session set current_schema = &&ut3_owner; |
| 54 | + |
| 55 | +--public API |
| 56 | +grant execute on &&ut3_owner..ut to &ut3_user; |
| 57 | +grant execute on &&ut3_owner..ut_runner to &ut3_user; |
| 58 | +grant execute on &&ut3_owner..ut_file_mappings to &ut3_user; |
| 59 | +grant execute on &&ut3_owner..ut_file_mapping to &ut3_user; |
| 60 | +grant execute on &&ut3_owner..ut_file_mapper to &ut3_user; |
| 61 | +grant execute on &&ut3_owner..ut_suite_items_info to &ut3_user; |
| 62 | +grant execute on &&ut3_owner..ut_suite_item_info to &ut3_user; |
| 63 | +grant execute on &&ut3_owner..ut_run_info to &ut3_user; |
| 64 | + |
| 65 | +--generic types |
| 66 | +grant execute on &&ut3_owner..ut_varchar2_list to &ut3_user; |
| 67 | +grant execute on &&ut3_owner..ut_varchar2_rows to &ut3_user; |
| 68 | +grant execute on &&ut3_owner..ut_integer_list to &ut3_user; |
| 69 | +grant execute on &&ut3_owner..ut_key_value_pairs to &ut3_user; |
| 70 | +grant execute on &&ut3_owner..ut_key_value_pair to &ut3_user; |
| 71 | + |
| 72 | +--expectations |
| 73 | +grant execute on &&ut3_owner..ut_expectation to &ut3_user; |
| 74 | +grant execute on &&ut3_owner..ut_expectation_compound to &ut3_user; |
| 75 | +grant execute on &&ut3_owner..ut_expectation_json to &ut3_user; |
| 76 | + |
| 77 | +--matchers |
| 78 | +grant execute on &&ut3_owner..ut_be_between to &ut3_user; |
| 79 | +grant execute on &&ut3_owner..ut_be_empty to &ut3_user; |
| 80 | +grant execute on &&ut3_owner..ut_be_false to &ut3_user; |
| 81 | +grant execute on &&ut3_owner..ut_be_greater_or_equal to &ut3_user; |
| 82 | +grant execute on &&ut3_owner..ut_be_greater_than to &ut3_user; |
| 83 | +grant execute on &&ut3_owner..ut_be_less_or_equal to &ut3_user; |
| 84 | +grant execute on &&ut3_owner..ut_be_less_than to &ut3_user; |
| 85 | +grant execute on &&ut3_owner..ut_be_like to &ut3_user; |
| 86 | +grant execute on &&ut3_owner..ut_be_not_null to &ut3_user; |
| 87 | +grant execute on &&ut3_owner..ut_be_null to &ut3_user; |
| 88 | +grant execute on &&ut3_owner..ut_be_true to &ut3_user; |
| 89 | +grant execute on &&ut3_owner..ut_contain to &ut3_user; |
| 90 | +grant execute on &&ut3_owner..ut_equal to &ut3_user; |
| 91 | +grant execute on &&ut3_owner..ut_have_count to &ut3_user; |
| 92 | +grant execute on &&ut3_owner..ut_match to &ut3_user; |
| 93 | + |
| 94 | +--reporters - test results |
| 95 | +grant execute on &&ut3_owner..ut_teamcity_reporter to &ut3_user; |
| 96 | +grant execute on &&ut3_owner..ut_xunit_reporter to &ut3_user; |
| 97 | +grant execute on &&ut3_owner..ut_junit_reporter to &ut3_user; |
| 98 | +grant execute on &&ut3_owner..ut_tfs_junit_reporter to &ut3_user; |
| 99 | +grant execute on &&ut3_owner..ut_documentation_reporter to &ut3_user; |
| 100 | +grant execute on &&ut3_owner..ut_sonar_test_reporter to &ut3_user; |
| 101 | +grant execute on &&ut3_owner..ut_realtime_reporter to &ut3_user; |
| 102 | +--reporters - coverage |
| 103 | +grant execute on &&ut3_owner..ut_coverage_html_reporter to &ut3_user; |
| 104 | +grant execute on &&ut3_owner..ut_coverage_sonar_reporter to &ut3_user; |
| 105 | +grant execute on &&ut3_owner..ut_coveralls_reporter to &ut3_user; |
| 106 | +grant execute on &&ut3_owner..ut_coverage_cobertura_reporter to &ut3_user; |
| 107 | +--reporters - debug |
| 108 | +grant execute on &&ut3_owner..ut_debug_reporter to &ut3_user; |
| 109 | + |
| 110 | +--reporters - base types |
| 111 | +grant execute on &&ut3_owner..ut_reporters to &ut3_user; |
| 112 | +grant execute on &&ut3_owner..ut_reporter_base to &ut3_user; |
| 113 | +grant execute on &&ut3_owner..ut_output_reporter_base to &ut3_user; |
| 114 | + |
| 115 | +--outputs |
| 116 | +grant execute on &&ut3_owner..ut_output_buffer_base to &ut3_user; |
| 117 | + |
| 118 | +--user temp tables |
| 119 | +grant select, insert, update, delete on &&ut3_owner..ut_compound_data_tmp to &ut3_user; |
| 120 | +grant select, insert, update, delete on &&ut3_owner..ut_compound_data_diff_tmp to &ut3_user; |
| 121 | + |
| 122 | +--needed for selecting from annotation objects |
| 123 | +grant execute on &&ut3_owner..ut_annotation_objs_cache_info to &ut3_user; |
| 124 | +grant execute on &&ut3_owner..ut_annotation_obj_cache_info to &ut3_user; |
| 125 | + |
| 126 | +--other grants |
| 127 | +grant execute on &&ut3_owner..ut_executables to &ut3_user; |
| 128 | +grant execute on &&ut3_owner..ut_executable_test to &ut3_user; |
| 129 | +grant select on &&ut3_owner..ut_suite_cache to &ut3_user; |
| 130 | +grant select on &&ut3_owner..ut_suite_cache_package to &ut3_user; |
| 131 | +grant select on &&ut3_owner..ut_suite_cache_schema to &ut3_user; |
| 132 | + |
| 133 | +grant select, insert, delete, update on &&ut3_owner..dbmspcc_blocks to &ut3_user; |
| 134 | +grant select, insert, delete, update on &&ut3_owner..dbmspcc_runs to &ut3_user; |
| 135 | +grant select, insert, delete, update on &&ut3_owner..dbmspcc_units to &ut3_user; |
| 136 | +grant execute on &&ut3_owner..ut_matcher_options to &ut3_user; |
| 137 | +grant execute on &&ut3_owner..ut_matcher_options_items to &ut3_user; |
| 138 | + |
0 commit comments