fix access check on stored procs and funcs