Added support for hidden apps (bug 1019249, 1019251)

you could put `limited = False` here for consistency. (or put `publish` above the `if` for consistency.)