-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEXAMPLE.excluding-obj-hooks1.lua
More file actions
41 lines (29 loc) · 1.16 KB
/
Copy pathEXAMPLE.excluding-obj-hooks1.lua
File metadata and controls
41 lines (29 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local std, _ENV = _ENV
local export = {}
function export.register_hooks(hooks_ctx)
function hooks_ctx:add_to_chunk_handler(obj_type, obj_values, directories,
filename, order, state_keys, state_mem, dump_data)
if directories and filename and order and state_keys and dump_data then
-- we will decide what to miss by pattern-matching
local obj_schema = obj_values.obj_schema or ''
local obj_name = obj_values.obj_name or ''
local role = obj_values.role or ''
if obj_type == 'grant_function' and
obj_schema:match('.+_taxi_.+') == obj_schema and
obj_name:match('get_.+') == obj_name and
role:match('.+_client') == role then
-- exclude these grants!
-- them will not be saved to sorted dump chunks
std.print('EXCLUDED:', obj_type,
std.table.concat(directories, '/') .. '/' .. filename)
return
end
-- others will not be ignored
std.print('PASSED:', obj_type,
std.table.concat(directories, '/') .. '/' .. filename)
end
return directories, filename, order, state_keys, dump_data
end
end
return export
-- vi:ts=2:sw=2:et