ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

User has to have upload privileges in order to view file details

November 02, 2012 7:45am

Subscribe [3]
  • #1 / Nov 02, 2012 7:45am

    Rick Lecoat

    128 posts

    I’ve got a list of files that are available for download to site members. I want only site admins to be able to upload these files but I want all site members (there are two other non-admin groups) to be able to download them from the page template. The files themselves are uploaded to a channel dedicated to this task, which includes fields for a description of the file and the file itself. The file field is called downloads_file. My template code for the list of files is as follows:

    <ul>
     {exp:channel:entries channel="documents_for_download" disable="categories|member_data|pagination" sort="asc"}
      <li><a href="http://{downloads_file}{url}{/downloads_file}">{title} ({downloads_file}{extension}{/downloads_file})></a></li>
     {/exp:channel:entries}
    </ul>

    And it works fine except that only members with upload privileges can see the content of the {downloads_file} tag pairs. And that’s my problem, because unless the user is logged into the site as a site admin the file extension and – more importantly – the URL do not get passed into the template. I tried removing the member_data part from my channel:entries tag’s disable parameter, but it made no difference.

    Is this a ‘feature’ or is it a bug?  Or am I just doing something wrong? How do I let members who do NOT have upload privileges download the files (and see the file type)?

    Thanks as always;
    Rick

  • #2 / Nov 02, 2012 9:39am

    Boyink!

    5011 posts

    Shouldn’t be an issue.

    Any template-level access rights being set?

    Can they view other content from the channel?

  • #3 / Nov 02, 2012 9:53am

    Rick Lecoat

    128 posts

    Hi Mike.

    The non-admin member groups both have viewing rights for the template in question (as shown under Template Manager > Access). All channel posting privileges are set to No (in Members > Members Groups >Edit member group) since they have no CP access anyway and my understanding is that those prefs relate to CP-level posting, not front-end stuff. Their Channel Assignment (same prefs) are also set to No for the channel in question. Were you thinking of some other set of prefs? They are rather scattered about the CP, so I’m not 100% sure I’ve covered everything 😉

    However, in answer to your 2nd question, yes they are able to see other content from the channel okay; you’ll notice in the code above I use the channel entry’s {title} tag as the link text for the file, and that shows up fine. But the document extension and the file’s URL are missing unless I am signed in as a user who has upload privileges, as per: File manager > File upload preferences > Member group (Can upload files: Y/N)

  • #4 / Nov 02, 2012 11:09am

    Boyink!

    5011 posts

    Stumped.

  • #5 / Nov 02, 2012 1:57pm

    Rick Lecoat

    128 posts

    Oh dear. Boyink is stumped. This does not bode well…

  • #6 / Nov 02, 2012 2:57pm

    Rick Lecoat

    128 posts

    FWIW I’m getting the same thing with images uploaded as part of a channel entry. If the person viewing a ‘News’ entry has permission to upload images to the ‘news_images’ file directory, then they can see the images in the single-entry page. If they cannot upload then they can’t see the images either. This doesn’t make much sense. If anyone from EL can let me know whether this is a bug or whether I’m just being a doofus with my CP settings and/or template code that would be most helpful.

    One workaround I guess would be to open up the directory uploads to all member groups but prevent the undesirable groups from uploading some other way. But that feels kludgy.

    Anybody have any wisdom to offer up here?

  • #7 / Nov 05, 2012 3:38pm

    Shane Eckert

    7174 posts

    Hey Rick,

    I would like to get in and see what you are seeing. Will be quicker than trying to reproduce and go back and forth.

    Be on the lookout for an email from EllisLab.

    Thank you,

  • #8 / Nov 05, 2012 5:32pm

    Rick Lecoat

    128 posts

    Thanks Shane. Your email received and responded to.

  • #9 / Nov 06, 2012 12:29pm

    Kevin Smith

    4784 posts

    Just posting a note here to let onlookers know that we’re working with Rick privately on this for the time being. I’ll post an update back here once we have something to share!

  • #10 / Nov 06, 2012 5:00pm

    Rick Lecoat

    128 posts

    Update: Problem solved.

    It appears that I had encountered this bug. Applying the code patch given on that page seems to have solved the problem and I’ve not come across any knock-on glitches.

    Thanks, as always, to Kevin and the team for their help in resolving this matter. It’s much appreciated.

  • #11 / Nov 06, 2012 5:34pm

    Kevin Smith

    4784 posts

    Glad to help, Rick! Have a good one.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases