I've noticed the following behaviour when calling SocialTagManager.Add:
- Regular call: tag created with myself as owner
- Call in
RunWithElevatedPrivileges: ditto - Call in
SPStatefulLongOperation: ditto - Call in
SPStatefulLongOperationthat usesRunWithElevatedPrivileges: tag created with the app pool account as the owner.
This is the worst possible behaviour for my use case; it means I can't easily add and remove tags as the app pool account in order to have "shared", rather than "user-specific", tags, but it means when I move SPWebs about in a long-running operation, I can't make the moved tags be owned by a real user!
What is SharePoint doing behind the scenes that means tags are added as a real user when either a long-running operation or elevated privileges are used separately, but when used together the tags are added as the app pool account?