Fixes #1576; Implemented a new 'restrict_callback' option for actions