Copied to clipboard

Flag this post as spam?

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


  • Lennart Stoop 304 posts 842 karma points
    Oct 04, 2010 @ 09:48
    Lennart Stoop
    0

    Extending the media library

    Hi everyone,

    I'm working on a project with multiple back-end users, each having their own private folder (start node) in the media library. Now, I would also need a (read-only) public repository which is accessible to all users.

    Has any of you ever implemented permissions or extended the media library like this before? Perhaps a customized media picker can do the trick?

    I'd love to hear your experiences and suggestions.

    Thanks!

    Lennart

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Oct 04, 2010 @ 11:35
    Ismail Mayat
    0

    Lennart,

    Maybe you could use tree events code so that for specific media folders (specified in config file) you dont get create / delete options?

    See http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/event-examples/remove-context-menu-items for more information on removing context menu items.

    Regards

     

    Ismail

  • Lennart Stoop 304 posts 842 karma points
    Oct 04, 2010 @ 12:46
    Lennart Stoop
    0

    Hi Ismail,

    Removing the context menu items would indeed restrict the usage in the media library as needed.

    I am not sure how the public repository can be shared though, as users are already restricted to their private one:

    - Public repository

    - Private repositories

    --- User A (start node for user A)

    --- User B (start node for user B)

    --- User C (start node for user C)

    In this setup, users cannot access the public repository however. 

    Any ideas? :s

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Oct 04, 2010 @ 14:04
    Ismail Mayat
    0

    Lennart,

    Then you could re organise the folders e.g

    Images

        Joe Bloggs

        Jane Bloggs

        Public

    Set all users start media folder to Images but using event handler if user logged in name does not match named folder dont show obviously public must always show.

    Regards

    Ismail

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 04, 2010 @ 14:56
    Dirk De Grave
    0

    I'd go with creating your own loadMedia class and just override the Render() method instead of building the event handlers to check permissions. On the other hand, this would require a db update to load your new loadMedia class instead of the default one.

    Or, if you don't want changes to the current db data, create another section, and use that section to load media items for the users handling the permission stuff. And give users access to that section instead of media.

    Or, another idea, use media section for public stuff and build a simple custom section for private stuff.

     

    Oh, what flexibility you have there.

     

    Cheers,

    /Dirk

  • Lennart Stoop 304 posts 842 karma points
    Oct 04, 2010 @ 15:33
    Lennart Stoop
    0

    Hey guys,

    Thanks for your suggestions.

    I will have a look into the media event handlers & loadMedia class and see what fits best.

     

    @Dirk: 

    Currently the project is still in dev, so data is not an issue.

    We have considered creating a custom media section, although we rather not create a second media section if its not necessary :)

     

    Will keep you posted.

    Thanks!

    Lennart

  • Comment author was deleted

    Oct 04, 2010 @ 15:44

    You could extend the media section with another tree 'public' that is basicly a copy of the media tree but with it's root set to your public media root. Don't think it would be that hard, just need to take a look at the current media tree node

  • Lennart Stoop 304 posts 842 karma points
    Oct 04, 2010 @ 16:02
    Lennart Stoop
    0

    Hi Tim,

    Wonderful idea! Will post some code when I have it working, cheers! :-)

  • Lennart Stoop 304 posts 842 karma points
    May 15, 2011 @ 19:55
    Lennart Stoop
    0

    It's been a while but I decided to package up this functionality

    http://our.umbraco.org/projects/backoffice-extensions/publicmediatree

  • Sam 3 posts 24 karma points
    Feb 06, 2012 @ 05:00
    Sam
    0

    @Lennart Stoop

    Thanks for your awesome package

  • Lennart Stoop 304 posts 842 karma points
    Feb 06, 2012 @ 08:49
    Lennart Stoop
    0

    Hi Sam, glad to hear it works for you as well! :-)

     

    Grtz

    L

Please Sign in or register to post replies

Write your reply to:

Draft