Per-app password in iOS 5.1 There is the overall locking password, which prevents the phone from being used. Is there a way to pasword-protect on a per-app basis, e.g. lock mail, but not photos. This is under iOS 5.1 on a iPhone 4S. The password doesn't need to be different between apps, however.

EDIT: This is with a iPhone 4S, not jailbroken.
No, there is no way to do this on iOS 5.1 or on any earlier version of iOS.

It's doubtful that Apple will add this feature, given their usual proclivity toward not including features that could be difficult to configure and support, particularly on iOS.

This of course means that each app developer can implement their own passcode locking mechanism. It's just not an API that Apple provides to developers to ask again for the same passcode before it operates as opposed to locking the entire device.