Copied to clipboard

Flag this post as spam?

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


  • MG 5 posts 85 karma points
    Aug 23, 2016 @ 13:22
    MG
    0

    Create and show list of Media items

    Hi,

    We are trying to create a page where members can upload files and later on see a list of them. Few specifics:

    • Members will be allowed to upload and see all kind of files
    • The uploaded files will be inserted in different Folders based on the Member`s group
    • Each member will be part of a Member group indicating the customer he is representing.
    • Each member should be able to see only the files which were uploaded by members of his/her Member Group

    So far we have created partial views via which we are uploading files into Media Library, but we are struggling with creation of logic for showing a list of those files. Can someone help me with this.

    Thank you in advance :)

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Aug 24, 2016 @ 17:18
    Marc Goodson
    0

    Hi MG

    Hmmm

    I would possibly create a RelationType (in the Developer section of Umbraco) between the Media Folder (Media) and the Member Group (Member Group). You would then related each Member Group to their appropriate Member folder.

    Info on relations: https://umbraco.com/follow-us/blog-archive/2012/12/7/getting-to-know-umbraco-relations/ https://our.umbraco.org/documentation/reference/management/services/relationservice

    This would enable you in a partial view to get details of the current logged in Member, see which Member Groups they are in, then query the Relations API to determine what the ids of the related Media folders are, then use Umbraco.TypedMedia to get a reference to the Media folders, and then use .Children to loop through the Media items and display links to the items the user is able to see.

    One thing to consider is that if a url of a media item from one group is sent to another person who is not in that group, there is nothing to stop that other person from viewing the media item on that Url. There is not out of the box a method in Umbraco for protecting Media by Membership.

    There is however a paid for package called Media Protect, that enables you todo that:

    https://our.umbraco.org/projects/website-utilities/media-protect/

  • MG 5 posts 85 karma points
    Aug 25, 2016 @ 11:20
    MG
    0

    Hi Marc,

    I will give it a try and see how it will turn out. Thank you for the help.

Please Sign in or register to post replies

Write your reply to:

Draft