You are not allowed to move this item into the Recycle Bin

Posted by Community Admin on 04-Aug-2018 19:02

You are not allowed to move this item into the Recycle Bin

All Replies

Posted by Community Admin on 14-Oct-2014 00:00

I'm trying to move a Dynamic Content item to the Recycle Bin in SF 7.1.5200.0, and the app is throwing an exception stating "You are not allowed to move this item into the Recycle Bin" on the call to MoveToRecycleBin() .  Here is the code I'm using.

try
    DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(String.Empty);
    Type moduleType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Vendors.Vendor");
    dynamicModuleManager.Provider.SuppressSecurityChecks = true;
 
    // Update a vendor record
    var vendor = dynamicModuleManager.GetDataItem(moduleType, masterId);
 
    dynamicModuleManager.RecycleBin.MoveToRecycleBin(vendor);
 
    dynamicModuleManager.SaveChanges();
catch (Exception ex)
    Console.WriteLine(ex);
This problem occurs when a front-end user tries to execute this code.  I can move this same Dynamic item to the Recycle Bin in the back-end with no issues.  This Dynamic object has Related Items and Related Media type fields in it.  Any insight into the error message.  Is it a permissions issue?

 Also, when I'm querying Dynamic Content items should I filter by the Visible or the IsDeleted property to exclude items in the Recycle Bin?

Posted by Community Admin on 17-Oct-2014 00:00

Hello,

The issue occurs because your frontend user doesn’t have needed permission to execute the code.

You could try to run the code in elevated mode like this:

using (new ElevatedModeRegion(dynamicManager))
        
            //your logic here
        

Please let us know if this work.

Regards,
Veneta Bogoeva
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 29-Oct-2014 00:00

ElevatedModeRegion makes sense, but I am still getting the same "You are not allowed to move this item into the Recycle Bin" exception.  Here is my updated code.

try
    DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(String.Empty);
 
    using (new ElevatedModeRegion(dynamicModuleManager))
    
        Type moduleType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Vendors.Vendor");
        dynamicModuleManager.Provider.SuppressSecurityChecks = true;
 
        // Update a vendor record
        var vendor = dynamicModuleManager.GetDataItem(moduleType, masterId);
 
        dynamicModuleManager.RecycleBin.MoveToRecycleBin(vendor);
 
        dynamicModuleManager.SaveChanges();
    
catch (Exception ex)
    Console.WriteLine(ex);

Posted by Community Admin on 30-Oct-2014 00:00

Hi Richard,

We are aware of this issue and it will be fixed for the next Sitefinity release.

If you are not able to wait for it, we can provide you with a way to bypass the problem, but it is considered a hack and my harm your security.

We are sorry for the inconvenience caused.

Regards,
Bobby
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 13-Aug-2015 00:00

This issue is still present in 8.0. Was it fixed in 8.1?

Posted by Community Admin on 28-Aug-2015 00:00

Hello Larry,

I have just tested this in Sitefinity 8.1 and the issue still reproduces. I have logged it as a bug in our feedback portal on the below link. Hopefully we will provide a fix for it for our future releases.

Anonymous users are note able to move content items to recycle bin using the API

You can subscribe to receive notifications for the bug including new comments, votes, status changes by clicking on the Follow this item link. If you would like to unsubscribe, you can unfollow the item by clicking on the "Following this item”. Once the problem is fixed the item will be marked as Done.

I sincerely apologize for the inconvenience caused by this issue.

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
 

This thread is closed