Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kim Andersen 1447 posts 2196 karma points MVP
    Nov 03, 2009 @ 14:30
    Kim Andersen
    1

    Disable "delete"-function on certain users in Media-section, and recover deleted media

    Is it possible to disable the "delete"-function in the media-section, to some of the users of an Umbraco site?

    I know it's possible to do it in the content tree, but what about the media section. My problem is that one of the users on one of my sites, have deleted a folder in the media section. But the folder shouldn't have been deleted, and I dont think that I can recover the folder. Can I?

     

    In v4.1 there will be a recycle bin in the media section. And I could for sure use that one right know on the site running v4.0.2.1 :)

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Nov 03, 2009 @ 15:03
    Dirk De Grave
    2

    Hi Kim,

    Do check whether the media folder has been deleted. It could still exists, altho nothing will ever link to it anymore. So, double check!

    You can prevent users from deleting nodes in the media section using event handlers. In your case, you could use the BeforeNodeRender to remove the 'Delete' item from the context menu. Richard has a great example on adding a menu item, so removing a menu item should be a breeze...

    Or, if you don't want to use that method, you could register for BeforeDelete event on Media object and cancel the deletion if user doesn't have the rights to do so.

    Hope this helps.

    Regards,

    /Dirk

  • Kim Andersen 1447 posts 2196 karma points MVP
    Nov 04, 2009 @ 15:54
    Kim Andersen
    0

    Hi Dirk.

    Actually my .NET-skills are at a very low state, so can you briefly explain how I can implements this? Or what I have to change from Richards code to make it work.

  • dandrayne 1138 posts 2262 karma points
    Nov 04, 2009 @ 16:21
    dandrayne
    0

    As for recovery of the folder, I think not.  A client recently did this to 700 images inside an "images" folder and we had no come-back. Thankfully a daily db backup got the media section back in order.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Nov 04, 2009 @ 16:44
    Kim Andersen
    0

    Damn Dan. That could easily have been a very bad day for that client.

    In our case, it wasn't that amout of images, but in some of the other folders in the media library, there's a lot more images than the one that got deleted. So removing the delete-function to any other users that the admin and webmasters, will for sure help out.

     

    Looking forward to v4.1 gets out of beta, so that we can just recover the images from the recycle bin :D

     

Please Sign in or register to post replies

Write your reply to:

Draft