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

i'm trying to achieve something that i'm not sure if it's possible or not.

I have a News system that uses multiple lists, permissions etc.

The permissions exist because only 1 person is able to approve/disapprove the news that are going to be shown on the Home Page. I have a list called "News - Home Approval" with 4 items "Approved, Waiting approval, Doesn't appear on the home page, Not Approved". I used a list for these items because only the administrator can see the options "Approved" and "Not Approved", but when anybody else is creating News, they see a dropdown list(lookup to the permission list) with the options "Doesn't appear on the home page" and "Waiting Approval".

The problem is, because of this 'permissioned' field, the common user (ones who only have permission to read content) can't see the items that are marked "Approved" on the lookup field.

With my user (admin) on the line:

 return (list.GetItems(q)).GetDataTable();

i always get 1 item (i have only 1 item on my News list and it's "Approved")

But when i'm using the common user, the same line returns 0 items.

i've tried using SPSecurity.RunWithElevatedPrivileges, but no success on that.

Not sure if i'm clear enough, but is there there a way to achieve what i'm trying to do?

Sorry for my crappy english.

Thank you.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You're looking for ModerationType = Moderator

You need to create an SPQuery as in this example to retrieve the listItems from your list but instead of in that example settting Scope Recursive instead set

oQuery.ViewAttributes = "ModerationType=\"Moderator\"";
share|improve this answer

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.