SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have a custom webpart , this webpart needs to be available for all users in site. It has a button which redirects to newform.aspx . Everything works for all users except visitors cannot access the newform.aspx to add items . How is it possible to make this work ?

share|improve this question

Give visitors the ability to add items to the list where the newform resides. You may need to create a custom permission level, break permissions inheritance on the list and apply this custom permission level to the Visitors group.

share|improve this answer
can anyone provide me with some links on hw to achieve this ? – Nikhil Jangle Sep 27 '11 at 16:14

By default the visitors group has a Read Only permission level. We need add item permission for adding the items to list, then only the user within that group gets the permission to view newform.aspx and add the item.

So, we have to break the permission for the group and associate the contribute (which has add, edit, and delete permissions) Permission level to Visitors Group.

share|improve this answer
up vote 0 down vote accepted
web.AllowUnsafeUpdates = true;
                        SPList list = web.Lists[adidas.Intranet.MySite.Code.Constants.ListQuickLinks.LISTQUICKLINKS];

                        //SPGroupCollection groupCollection = list.ParentWeb.SiteGroups;
                        //SPGroup group = groupCollection["NT AUTHORITY\\Authenticated Users"];
                        SPUser allUser = web.AllUsers["NT Authority\\Authenticated Users"];

                        SPRoleDefinitionCollection roleDefCollection = list.ParentWeb.RoleDefinitions;
                        SPRoleDefinition roleDefinition = roleDefCollection["Contribute"];

                        SPRoleAssignment roleAssignment = new SPRoleAssignment((SPPrincipal)allUser);
share|improve this answer

Your Answer


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.