+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Blog Permissions Issue

Blog Permissions Issue

3 posts, 0 answered
  1. Andrew
    Andrew avatar
    7 posts
    Registered:
    22 Jul 2011
    04 Jan
    Link to this post

    I've recently been added to a project for our team where we are redesigning the site as well as upgrading our version of Sitefinity from 6.2 to 8.1.

     

    Our site currently has a widget that is a entry form, however when the form is submitted, the information is entered into an unpublished Blog entry using the Sitefinity API.  

     

    When trying to get this widget to work with 8.1, I started to receive this error: "You are not authorized to 'Modify blog and manage posts' ('BlogPost')."  It happens with this line of code:

    blogsManager.SaveChanges();

     

    I asked the developer of the widget about this and he said that this line should work (it works for the 6.2 version, not 8.1):  

     

    App.WorkWith().BlogPosts().GetManager().Provider.SuppressSecurityChecks = true;

     

    Any ideas?

     

    Thank you,

    Andrew

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Sep 2016
    06 Jan
    Link to this post
    Hi Andrew,

    You can try to use the native API. Testing the following code sample on a published and unpublished posts seems works fine with unauthenticated user:
    var blogManager = BlogsManager.GetManager();
    blogManager.Provider.SuppressSecurityChecks = true;
    var posts = blogManager.GetBlogPosts();
    foreach (var post in posts)
    {
        post.Title += " - New";
    }
    blogManager.SaveChanges();
    blogManager.Provider.SuppressSecurityChecks = false;

    I hope this helps.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Andrew
    Andrew avatar
    7 posts
    Registered:
    22 Jul 2011
    06 Jan in reply to Svetoslav Manchev
    Link to this post

    Svetoslav,

    This works perfectly.  Thank you for your assistance!

    Andrew

3 posts, 0 answered