Blog Permissions Issue

Posted by Community Admin on 04-Aug-2018 16:30

Blog Permissions Issue

All Replies

Posted by Community Admin on 04-Jan-2016 00:00

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

Posted by Community Admin on 06-Jan-2016 00:00

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
 

Posted by Community Admin on 06-Jan-2016 00:00

Svetoslav,

This works perfectly.  Thank you for your assistance!

Andrew

This thread is closed