Approving document library items from Object model in WSS 2.0
-
10-12-2019 - |
Question
What is the correct way to approve an item in WSS 2.0 through the object model? I have some code that was recently modified to auto approve items that met certain criteria by another developer. That developer has left however, and now we are finding that ALL items are being approved, regardless of whether or not they meet that criteria.
I'm pouring through the literally thousands of lines of code looking for where this is happening.
Alternately, is there a permission group that grants approval rights? I know the users the code runs as, so I could alter those if such a thing exists. However, despite finding some mention of it in the MS docs, on our own installation I don't see the permission listed anywhere.
Thanks. Please let me know if I can provide more information - I'm not well versed in SP programming.
Solution
For future googlers:
The proper way to approve an item & add a comment via object model is
newItem.ModerationInformation.Status = SPModerationStatusType.Approved;
newItem.ModerationInformation.Comment = "Automatic Approval";