Refactor user_can_access_case method