abstract out checkAccessCb