Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2010-09-03
4
572 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
ID: 33595109
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
ID: 33595481
Thanks Pstry! but i want to do it programacally....
any idea??
0
 
LVL 4

Accepted Solution

by:
Pstry earned 125 total points
ID: 33595508
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
ID: 33595793
thanks Pstry,
that helped :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

808 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