Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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";
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.