Change owner of Blog Post?

Posted by Community Admin on 03-Aug-2018 14:23

Change owner of Blog Post?

All Replies

Posted by Community Admin on 20-Aug-2012 00:00

Given all the fine-grained permissions in SF, i thought it would have been easy to change the owner/author of a blog post, but apparently not. Or maybe it is? Please, can someone enlighten me?

Posted by Community Admin on 20-Aug-2012 00:00

Hi Michael,

I'm afraid you should do this manually, if you want this. Instead of doing this right in the database, I suggest to use the API.

If it is because you want to show another 'name' with your blogpost, I think you'd be better off to create a custom field for the BlogPost and add an 'Author' field.

Regards,
Daniel

Posted by Community Admin on 20-Aug-2012 00:00

Why is there a permission to change the blog post owner if it is not possible?

Posted by Community Admin on 18-Apr-2013 00:00

I have the same question...since the permission exists to change a blog post's owner, I thought there would be an action or other option to change a blog post's owner. Is this coming in a future relase? I am currently using 5.4.

Posted by Community Admin on 11-Jan-2015 00:00

Sweet,.. just got to this question in 2015. Can't find this though in SF 6.3.5000. Maybe it's in 7.3? Can anyone confirm? I will resort to API,. which explains why there is a permission setting for it, albeit, it'd be nice for the backend admin pages to include this fine functionality :P

Posted by Community Admin on 14-Jan-2015 00:00

Hi Richard,

Currently, it is not possible to change the owner of a content item through the Sitefinity backend UI. We have logged this as a feature request in our feedback portal on the following link and we hope that we will have this functionality out of the box for our future releases.

Currently, you can change the owner of a content item using our API. There is an Owner property for every content item so if you use for example our sample for Modifying blog posts from this documentation article, you could set the new Owner. Here is a sample code for your convenience for changing the owner of a blog post:

private void ChangeNewsOwner(string blogPostTitle, string adminUserName)
        
            BlogsManager blogsManager = BlogsManager.GetManager();
 
            //Get the master version.
            BlogPost master = blogsManager.GetBlogPosts().Where(b => b.Title == blogPostTitle && b.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Master).FirstOrDefault();
 
            if (master != null)
            
                // Find the user who will be the new Owner
                UserManager usermanager = UserManager.GetManager();
                var adminUser = usermanager.GetUsers().Where(u => u.UserName == adminUserName).FirstOrDefault();
 
                if (adminUser != null)
                
                    master.Owner = adminUser.Id;
                
 
                master.LastModified = DateTime.UtcNow;
 
                blogsManager.Lifecycle.Publish(master);
                blogsManager.SaveChanges();
 
                //Publish the news item.
                var bag = new Dictionary<string, string>();
                bag.Add("ContentType", typeof(BlogPost).FullName);
                WorkflowManager.MessageWorkflow(master.Id, typeof(BlogPost), null, "Publish", false, bag);
            
        


Regards,
Sabrie Nedzhip
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 28-May-2015 00:00

Sabrie! Works. Thanks. Made a widget out of this. 

This thread is closed