Skip to content
Snippets Groups Projects
Commit c271506e authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

feat: grant 'public' access to .proc_* with `pub` visibility

parent a520a5c3
No related branches found
No related tags found
1 merge request!855Gmoshkin/service auth
...@@ -237,12 +237,16 @@ fn init_handlers() { ...@@ -237,12 +237,16 @@ fn init_handlers() {
let lua = ::tarantool::lua_state(); let lua = ::tarantool::lua_state();
for proc in ::tarantool::proc::all_procs().iter() { for proc in ::tarantool::proc::all_procs().iter() {
lua.exec_with( lua.exec_with(
"box.schema.func.create('.' .. ..., "local name, is_public = ...
{ language = 'C', if_not_exists = true } local proc_name = '.' .. name
);", box.schema.func.create(proc_name, {language = 'C', if_not_exists = true})
proc.name(), if is_public then
box.schema.role.grant('public', 'execute', 'function', proc_name, {if_not_exists = true})
end
",
(proc.name(), proc.is_public()),
) )
.expect("box.schema.func.create should never fail"); .expect("this shouldn't fail");
} }
lua.exec( lua.exec(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment