#746548 by xjm: Fixed critical bug in hook_db_rewrite_sql() that prevented create/list permissions from functioning properly.