Skip to content

Commit

Permalink
grant execute on javascript to user not to public
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippSalvisberg committed Nov 26, 2023
1 parent ce0e162 commit abbddc2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/dbconfig.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Philipp Salvisberg <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import oracledb from "oracledb";

let sysSession: oracledb.Connection;
Expand All @@ -21,7 +37,6 @@ export const mleConfig: oracledb.ConnectionAttributes = {
export async function createSessions(): Promise<void> {
sysSession = await oracledb.getConnection(sysConfig);
await createUser(mleConfig);
await sysSession.execute("grant execute on javascript to public");
sysSession.close();
mleSession = await oracledb.getConnection(mleConfig);
}
Expand All @@ -35,6 +50,7 @@ async function createUser(config: oracledb.ConnectionAttributes): Promise<void>
quota 1m on users
`);
await sysSession.execute(`grant db_developer_role to ${config.user}`);
await sysSession.execute(`grant execute on javascript to ${config.user}`);
}

export async function closeSessions(): Promise<void> {
Expand Down

0 comments on commit abbddc2

Please sign in to comment.