Solved

Prevent SP2010 list from adding new Items and Editing existing items.

Posted on 2010-09-03
4
570 Views
Last Modified: 2012-05-10
Hi,
can anyone please tell me if there is a way to prevent SharePoint 2010 list from adding new Items and Editing existing items through program (probably in Schema file of list).
thanks
0
Comment
Question by:aqibsp82
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:Pstry
Comment Utility
I think that the simplest solution is to change list security. Just remove contributor permissions (or change them to read).

The second possibility is:

- go to the advanced list settings
- in "Item-level Permissions" section select "None" in "Create and Edit access".

The latter solution does not work in document library.

 

Item-Level-Permissions.png
0
 

Author Comment

by:aqibsp82
Comment Utility
Thanks Pstry! but i want to do it programacally....
any idea??
0
 
LVL 4

Accepted Solution

by:
Pstry earned 125 total points
Comment Utility
In C#:

SPList list;

// list = .... // load your existing list
list.WriteSecurity = 4; // 1="All items", 2="Own items", 4 = "None"
list.Update();

if you want to create list from schema - edit Elements.xml, as in the following example (full template omitted for brevity). Note "4" in "SecurityBits":

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <ListTemplate
      .....
      SecurityBits="14"
      ....
    />
</Elements>
0
 

Author Comment

by:aqibsp82
Comment Utility
thanks Pstry,
that helped :)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now