I have given SPUser user1 permission to only SPFolder I dont want to give read access to specific site or document library.

suppose there is one web http://contoso.com/sales and i want to give permission to only Folder Test which exist on Shared Documentscode worked fine as expected but when user logged to sales site.Add Document link is disappear on Test folder of doc lib.

Here is code:

                SPUser AssignedUser1 = oweb.SiteUsers["i:0#.f|aspnetmembershipprovider|user1"];
                if (AssignedUser != null)
                    SPRoleDefinitionCollection WebRoles = salesweb.RoleDefinitions;

                    SPRoleAssignment roleAssignment = new SPRoleAssignment(AssignedUser);
                    roleAssignment.RoleDefinitionBindings.Add(WebRoles["Full Control"]);
                    #region Assign Role To Requirement List.

                    SPList olist = salesweb.Lists["Shared Documents"];

                    // get a reference to the folder (this assumes path points to a valid folder)
                    SPFolder folder = salesweb.GetFolder(olist.RootFolder.Url + "/Test");
                    if (folder.Exists)
                        SPListItem item = folder.Item;
                        if (!folder.Item.HasUniqueRoleAssignments)
                            folder.Item.BreakRoleInheritance(true); // Ensure we don't inherit permissions from parent


see below screenshot after logged user1 to sales site.

enter image description here

i can able to add documents using ribbon toolbar to the folder. but can't see Add document link to the user1.

Hows to solved it?

1 Answer 1


If you need to get the add document link. Click on the top Right of the web part and choose Edit Web Part. In the List Views types on Toolbar Type Choose Full Toolbar or Summary Toolbar. Hope this helps.


  • Hi. but actully full access users can able to see the Add Document link. Apr 2, 2013 at 6:33
  • Hi. Yes full users can be able to see the add document. In cases like if it is not available you could follow the above method. Apr 2, 2013 at 6:41
  • I have tried. No luck :( Apr 2, 2013 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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