How to grant anonymous access on sharepoint document library/list only not for web application

Hello
How to grant anonymous access on sharepoint document library/list only not for web application.I have claim based sharepoint site and has to be but i want to grant access on document library/list only.Is this possible?
Thanks
Rajesh Kumar "Changing the Face" can change nothing.But "Facing the Change" can change everything.

As i am using following code
SPSite site = SPContext.Current.Site;
            SPWeb web = SPContext.Current.Web;
            SPSecurity.RunWithElevatedPrivileges(delegate()
                using (SPSite ospSite = new SPSite(site.ID))
                    using (SPWeb webs = ospSite.OpenWeb(web.ID))
                        // Enable anonymous access on web application
                        webs.AllowUnsafeUpdates = true;
                        SPUrlZone urlZone = SPUrlZone.Default;
                        SPWebApplication specifiedWebApplication = ospSite.WebApplication;
                        SPIisSettings iisSettings = specifiedWebApplication.IisSettings[urlZone];
                        //iisSettings.AuthenticationMode = AuthenticationMode.Windows;
                        iisSettings.AllowAnonymous = true;                       
                        specifiedWebApplication.Update();
                        // Get document library collection here and fetch all the document urls
                        SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists["Documents"];
                        if (docLib != null)
                            docLib.BreakRoleInheritance(true, false);
                            docLib.AllowEveryoneViewItems = true;
                            docLib.AnonymousPermMask64 = SPBasePermissions.ViewPages | SPBasePermissions.OpenItems | SPBasePermissions.ViewVersions
                                | SPBasePermissions.Open | SPBasePermissions.UseClientIntegration | SPBasePermissions.ViewFormPages | SPBasePermissions.ViewListItems;
                            //docLib.AnonymousPermMask64 = SPBasePermissions.EmptyMask;
                            docLib.Update();
Should working but getting access denied......i am totally stuck at this point.
Rajesh Kumar "Changing the Face" can change nothing.But "Facing the Change" can change everything.

Similar Messages

  • Advice needed for provider hosted web application - authentication and access to SharePoint document library

    I haven't done SharePoint 2013 development with claims so I apologize in advance if my assumptions and questions are way out in left field.
    I'm trying to understand SharePoint 2013 claims authentication for a scenario that involves:
    A SharePoint provided hosted (web forms) app that will pull information and assets (e.g. PDFs) from SharePoint into the web page.
    It will be a VS 2012 solution with asp.net.identity feature.
    Security will be set for internal users, federated external users and forms-based external users.  Based on their security and (claim type) role it will define what information and assets that can be retrieved from SharePoint
    I have looked through MSDN and other sources to understand.
    This one helped with my understanding 
    Federated Identity for Web Applications and assumed that the general concept could be applied to forms-based identity for non-Federated external users .
    What I have now:
    VS 2012 solution web forms application set to Provider Host with asp.net.identity feature and its required membership tables.
    I can create new users and associate claims to the new user.
    I can log in with a user from the membership tables and it will take me to a default.aspx page.  I have added code to it that displays the claims associated to a user.
    For POC purposes I'd like to retrieve documents that are associated to this user from the default.aspx page.
    This is where I am having trouble understanding:  Is my understand correct?
    Internal users
    since they are internal on the network i am assuming that they would already have access to SharePoint and they would already be configured to what documents that they have available to them.
    Federated external users & Forms authentication external users
    it seems to me that the authentication for external users are separate from SharePoint authentication process.
    changes to the configuration settings are necessary in SharePoint, IIS, web application.
    I believe this is what i read.
    claims processes (e.g. mappings) need to be set up in SharePoint
    as long as external users are authenticated then things are ok b/c they would have claims associated to the user and the configuration in SharePoint takes are of the rest.
    This statement bothers me because I think it's wrong.
    So basically i'm stuck with if my understanding is correct: once a user is authenticated either by federated identity or asp.net.identity authentication that it should go to the provider hosted default.aspx page because the claim is authenticated and means
    that it should have access to it and the SharePoint document library based on some claim property.  I could then write the calls to retrieve from a document library and SharePoint will know based on some claim property that the logged in user can only
    access certain documents.
    It just sounds too good to be true and that i'm missing something in the thought process.
    Thanks in advance for taking the time to read.
    greenwasabi

    Hi GreenWasabi,
    i agree this is an interesting topic to discuss,
    as you can check from the article, you may check this example from the codeplex:http://claimsid.codeplex.com/
    when i thinking regarding this topic, its looks like an environment with multiple of realms,
    from what you understand, its correct that all the authentication is based from the provider, so for example i have a windows live ID and internal ID, then when i login windows live ID, it will be authenticated using windows live ID server.
    here is the example for the webservice:
    http://claimsid.codeplex.com/wikipage?title=Federated%20Identity%20for%20Web%20Services&referringTitle=Home
    as i know, if you using this federated, i am not quite sure that you will need to go to the provider page literally, perhaps you can check this example if we are using azure:
    http://social.technet.microsoft.com/wiki/contents/articles/22309.integrating-windows-live-id-google-and-facebook-accounts-with-sharepoint-2013-white-paper.aspx
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How to rename the SharePoint Document Library existing file name using Web service

    Hi,
    How to rename the SharePoint Document Library existing file name using SharePoint Web service.
    Is it possible. How could i do it?
    Thanks & Regards
    Poomani Sankaran

    Hi,
    Lists.UpdateListItems Method
    would be helpful for your requirement.
    Here is a blog with code demo for your reference:
    http://blogs.msdn.com/b/knowledgecast/archive/2009/05/20/moss-using-the-list-web-service-to-rename-a-file.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to filter the Files from SharePoint Document Library based upon cloumn value

    Hi
    I should filter the files from document library. I have column called "Print Status" for the document library the value would be either "Yes" or "No".
    Now i should filter out the files which has "Print Status" as a "Yes".
    I am using SPFolder and SPFile from SharePoint Object Model to traverse the file in doc library.
    How could i do it?
    My Sample code:
    foreach (SPFolder childFolder in folder.SubFolders)
      if (childFolder.Name != "Forms")
        AspControls.TreeNode trn = new System.Web.UI.WebControls.TreeNode(childFolder.Name, "", "~/_layouts/images/itdl.gif", childFolder.ServerRelativeUrl.ToString(), "");
        newNode = TraverseFiles(childFolder, trn);
                                // add the new node to the tree
                                rootNode.ChildNodes.Add(newNode);
                        // loop through the files
                        foreach (SPFile childFile in folder.Files)
                            // create a new node and add to the tree
                            AspControls.TreeNode childNode = new System.Web.UI.WebControls.TreeNode(childFile.Name + " (" + childFile.TimeLastModified.ToShortDateString()
    + ")", Convert.ToString(childFile.Item["ID"]), "~/_layouts/images/" + childFile.IconUrl, childFile.ServerRelativeUrl.ToString(), "");
                            rootNode.ChildNodes.Add(childNode);
    Thanks
    Poomani Sankaran.

    Why do you transvers the file an not use a camp query? In a CAML query you can filter the print status and are able to get all files and folder objects at once.
    Check out the following post: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8c45b5e2-1fb8-435c-a97d-1d8c6d288d4c/caml-query-to-query-all-the-files-and-folders-in-document-library?forum=sharepointdevelopmentprevious
    Kind regards
    Stefan
    http://www.n8d.at/blog
    Follow me on Twitter: StFBauer |
    n8design
    Microsoft Community Contributor 2011 / 2012
    MCTS - SharePoint / WSS Configuration and Development

  • XSL variable-of document name from document library list does not render

    I'm currently building a custom XSL file that is to be linked to a webpart so I can create a custom view. I must say I am new to XSL coding though I have background in html, javascript, php.
    I'm able to render general columns that has been added (from document properties) in the document library I'm pulling data from but cannot seem to figure out how to render out the title. It is a document library so it is to be pulling the name of the document
    added to the library.
    In the aspx, I did try changing all name types (ones with links, without, with edit etc.) but no luck.
    Here is my xsl code so far:
    <xsl:template name="block.rowview">
    <style>
    .sktile{
    width:200px; height:200px; border:#000 solid thin;
    float:left; margin:5px; overflow:hidden
    </style>
    <div class="sktile">
    <xsl:value-of select="@LinkFilename" />
    <xsl:value-of select="@Description0" disable-output-escaping="yes"/>
    <xsl:value-of select="@Recording_x0020_Date" />
    <xsl:value-of select="@Presenter" disable-output-escaping="yes"/>
    <xsl:value-of select="@Tools" disable-output-escaping="yes"/>
    </div>
    </xsl:template>
    And here are the field references:
    <FieldRef Name="LinkFilename"/>
    <FieldRef Name="Recording_x0020_Date"/>
    <FieldRef Name="Presenter"/>
    <FieldRef Name="Tools"/>
    <FieldRef Name="Description0"/>
    So the field I'm struggling to show is the "LinkFilename" It would be great if someone can point out what I'm missing or what I'm doing wrong. Thanks in advance!

    Hi, Paul
    Here are two VIs. Local1 return an error while building and local2 works fine.
    Please let me know what's wrong!
    In previous messege I've asked for a list of bugs in 8.20 and 8.0.1, do you know if it is available?
    Thank you,
    Andrej
    Attachments:
    local1.vi ‏11 KB
    local2.vi ‏12 KB

  • How to Enable Anonymous access to a SharePoint 2013 site e.g for specific site,list etc..

    Hi All,
          I'm working on an extranet and i would like users to be able to fill a form on the site.
    Since i'm going to use sharepoint 2013 how can i configure sharepoint to use both anonymous access and windows authentication at the same time.
    I know for sure it can be done but what can be allowed for anonymous access e.g specific list site etc..
    I would need to make some area available as anonymous e.g a whole site as  i would like to brand it a little to host the form.Any tips of who has configured similar would be appreciated

    Hi Patrick,
    Thanks for posting your query, Kindly follow the below mentioned steps to enable Anonymous access to a SharePoint 2013 site.
    In Central Administration, under Application Management., click Manage web applications.
    Select the web application you want to enable anonymous access for.
    In the Security group on the ribbon, click Authentication Providers.
    In the Authentication Providers dialog box, under Zone, click Default.
    On the Edit Authentication page, select the Enable anonymous access check box.
    Click Save.
    Close the Authentication Providers dialog box.
    Also, browse the below mentioned URLs for more details
    http://blog.cloudshare.com/2012/10/15/how-to-enable-anonymous-access-to-a-sharepoint-2013-site/
    http://www.sharepoint-journey.com/how-to-enable-anonymous-access-in-sharepoint-2013.html
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Upload Multiple documents in SharePoint document Library not working

    Hi All,
            I have folder on my desktop which consists of nested folders and files(Total 11 files) .And when I select "Upload multiple files" option to upload documents and drag the folder from the desktop in pop-up window .
             The sharepoint document library uploads only 1 file among all the nested folders from 11 files.Can any one help me how can I solve this
    Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .

    Hi,
    I understand you encountered the issue when use "Upload Multiple Documents" to Drag Files and Folders to upload window.
    When you say "The sharepoint document library uploads only 1 file among all the nested folders from 11 files", do you mean you have drag all files and folders to the window, while only 1 file is uploaded sucessfully? Or you cannot find all expected
    folders and files?
    Please manually open "Windows Explorer" to locate files and drag files from "Windows Explorer", instead of using the "Open window"
    opened by "Browse for files instead" as below:
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to control access to a document library based on fields of the list?

    Hi, 
    I need to give access to a document library but the users who need permission are unknown until the form
    is submitted to the document library.  The 2 users information are in 2 fields of the form.  I created a infopath form and a workflow with it.
    I need to give the "CreatedBy" user, the person who completed and submitted the form, and the
    Requester (a data field on the form), both need access to the new document library or just to the forms they submitted.  How do I setup access for the createor and requester of the form?  These are unknown until the time of the form submission and
    it's dynamic.
    Anyway to implement this in SP?  If not what about coding for when the form is loaded.  Can
    someone point me to a sample coding for ref fields in the form when form is first loaded up?  Also, how to redirect to a access denied view in the code.
    Thank you.

    It's not easy OOTB but it can be done if you either use code or use some code someone else created.
    Have a look at this on codeplex
    https://spdactivities.codeplex.com/wikipage?title=Grant%20Permission%20on%20Item

  • Block sharepoint document library recycle bin access by normal user

    Any method to block sharepoint document library recycle bin access by user with Contribute permission?
    I am using SharePoint 2010 Foundation.

    you need to edit the master page and use SPSecurityTrimmedControl in order to get it done.
    here is good blog based on the user permision.
    http://www.learningsharepoint.com/2010/07/06/hiding-view-all-site-content-and-recycle-bin-link-from-quick-launch/
    another way is hide from all pages using css.
    http://www.ilikesharepoint.de/2012/06/sharepoint-2010-how-to-hide-the-recycle-bin-and-the-all-site-content-links/
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • I saved a spreadsheet to iCloud now I can not access it.  The message I get say I need a newer version of Numbers but I already have it.  How do I get access to my document on iCloud?

    I saved a spreadsheet to iCloud now I can not access it.  The message I get says I need a newer version of Numbers but I already have it.  How do I get access to my document on iCloud?

    Please see this user tip:
    Need newer version of Numbers to open file

  • How to upload email from outlook to a sharepoint document library programatically.

    Hi ,
    I have a requirement where I need to create a outlook plugin which will upload selected emails to sharepoint document library. I am able to hold email using by creating the object of outlook.item.  but could n't find a way to upload created com object
    in to sharepoint library.
    I need to use webservice to upload email to the document library.
    can some one please help me with this?
    Thanks.

    Hi,
    Base on the description, you want to upload email from outlook to a sharepoint document library programatically.
    We need to do it using Web Services, there's a purpose built web service here http://cecildt.blogspot.com/2010/10/upload-documents-to-sharepoint-2010.html‎
    for uploading documents.
    The other alternative is using email enabled document libraries
    https://www.nothingbutsharepoint.com/sites/itpro/pages/how-to-setup-mail-enabled-document-libraries-in-sharepoint-2010-part-4.aspx
    Best Regards,
    Linda
    Li

  • How to connect SharePoint Document Library with Local file system?

    Hi
    I have a SharePoint Document library and in my local system i have 3TB files. It is very difficult to upload 3TB files in SharePoint.
    I want a file details in SharePoint Document Library but physical file would be in local.
    While click the file in Document library. The document should open from local.
    Anyone help me on it.
    Thanks & Regards
    Poomani Sankaran

    Hi,
    your requirement doesn't work out-of-the-box as all data uploaded to SharePoint needs to be stored in SQL database. Thus in your case 3 TB of fileshare would need to move to SQL.
    In case you don't want to go this way, there are 3rd party vendors who offer Software like AvePoint Connector. Products like these use SQL RBS (Storage Externalization API) so that files remain in your file system but metadata is kept in SharePoint. If you
    need more information on that, please let me know.
    Regards,
    Dennis

  • How to display the thumbnail view of the documents in Sharepoint Document Library

    Is there a way that we can have the thumbnail view of the documents that are uploaded in SharePoint Document Library. We have thumbnail feature in Picture Library but can we have the same in Document Library too. Documents includes Words,Excel,PDF.
    Any Suggestions Please 

    Hey Mike,
    Good post, I'd be curious to see if anyone has used the GD Picture SDK with SharePoint, maybe there would be some sample code.
    Hey Kukdai,
    Developing your own solution would potentially provide a better way to accomplish your task, but before setting out on that long road you may want to try the simple customization, it's less time consuming and it will help gauge your customer's interest and
    support.
    Also, there is a wealth of open source code for SharePoint available on CodePlex, you might want to check that out as well.  Here is the linK:
    http://www.codeplex.com/
    Also, here is an interesting project to consider for your task:
    http://enhancedpicture.codeplex.com/
    I hope that helps!
    Tom Molskow SharePoint Architect - If I solved the issue please propose my reply as the answer - Thanks!

  • Sharepoint document library file name column in content database?

    Hi,
    How to get a sharepoint document library file name column in content database?
    Thanks
    Poomani Sankaran

    You're not supposed to develop any solutions accessing the content database directly. It's not supported. Document Library Filename is stored in LeafName column, table: AllDocs.
    2.2.6.1 AllDocs Table
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Delivery Error when creating Sharepoint Document Library subscription

    Recently we have been having issue with a subscription from a report we have.
    We have a report that has been generated and have a subscription from that report to create a PDF document within sharepoint.
    Recently the subscription stopped working and we have these errors showing:
    A delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.DeliveryErrorException: A delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidExtensionParameter: One of the extension parameters
    is not valid for the following reason: Failed to validate the delivery setting PATH.The specified user USERNAME could not be found.
          Failed to validate the delivery setting PATH.The specified user USERNAME could not be found
    Looking into this, I found a few things but they did not help.
    One thing was to install update 5 for SQL server 2012 R2, but that didn't help.
    Another thing was saying something about there being 2 user accounts, a claims account and a windows user account, but I couldn't figure out how to make it use the correct account.
    I also tried to save it to a Windows File Share, and try to save it to the Sharepoint server side, however that failed stating it couldn't find that path.
    Being that sharepoint is tricky with its file store (is there really a location on the server that files are stored, I cant find it) I could not figure it out.
    I know I can windows explorer to the file location, \\site\shared documents\Folder but if I go to the web servers that host sharepoint I can't find where this path really is.
    Thanks

    Hi,
    According to your post, my understanding is that you want to get error in accessing sharepoint document library files.
    The cause is that the account being used to validate accounts on the production domain had been set to expire the password according to the general domain policy.
    Once the account is set to never expire, the issues will disappear.
    For more information, you can refer to:
    http://kb4sp.wordpress.com/2012/12/05/user-cannot-be-found-shenanigans-one-way-active-directory-trusts-and-sharepoint-2013/
    http://blogs.msdn.com/b/cliffgreen/archive/2013/02/19/sharepoint-2013-the-directory-is-not-a-subdirectory-of-the-root-directory.aspx
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • Disable iCloud after apple id changed?

    Hi, I changed my apple id primary address on the web but forgot to sign off iCloud and "Find My iPhone" on my iPhone 5. After I upgraded my iPhone 5 from iOS 7 to iOS 8, it starts asking me iCloud password associated with the old email id, but it no

  • Text Hyperlink from PDF (converted Word doc) to specific Excel cell in same Portfolio

    Good Morning, I have created a Word document with an embedded Excel sheet (both Office 2007) and created a text hyperlink within the document that points to a specific cell on a specific tab. My company wants to send our document to a customer, but w

  • Armoured

    I recently had to reinstall my Photshop 6.0 following hard drive problems.  Now I am presented with the following message when I attempt to access the organiser. MS Visual C++ Runtime Library This application has requested the runtime to terminate it

  • PU19 recording

    Hi, I need to call PU19(module pool program) from my prog and want to write the pdf form to application server(without displaying to the user). So I am doing BDC recording of PU19 but not able to do that. I have to generate W2 form (from Annual tab)

  • A user exit for table KONV

    Hi, I am looking for a User Exit that will enable me to update the fields of the conditions table KONV, while entering materials during the process of a Sales Order in VA01 or VA02. Thanks, Amit Shur