I installed this module but it's not working. I have uploaded a zip file to the /private folder and only the users assigned the teacher role are allowed to download this zip file. But users with Teacher role are not able to download the zip files. It says "Access Denied".

Comments

katy5289’s picture

Category: bug » support
johnhanley’s picture

I don't know what to tell you. The module works as described when configured correctly. Double-check your setup. Check the other issues in this project for additional tips.

katy5289’s picture

Category: support » bug
katy5289’s picture

What do you mean when configured correctly? There's no readme.txt or any documentation with this module. I set the permissions for the teacher role to download the zip file in the private folder and it DOES NOT WORK for users assigned the teacher role. However, when I'm logged in as Super User, I can download the files properly.

johnhanley’s picture

Trust me, this is not a bug. Check out my comment in this thread for some configuration tips:

http://drupal.org/node/906624#comment-3428520

Honestly, that's all there is to it.

kbk’s picture

Category: bug » support

katy5289 - I've placed some basic documentation here: #967160: How to setup Private Download and use with CCK FileField. Please suggest changes (or contribute your own documentation!) once you figure out what is going on.

Also, have you tried clearing Drupal's cache folders (admin/settings/performance)?
Also, check permissions related to the upload/filefield modules and fields for the teacher role?

webkenny’s picture

Category: support » bug

There must be something amiss here because this module doesn't seem to work for the role I've allowed access to. I've tried every permutation I can think of at this point. The only user in the site who can successfully download a file with this module on is User 1. Reviewing the code, everything looks normal though.

Are there any known conflicts between this module and others that could be causing this problem? The only access module I have enabled is "Content Access" which should have no bearing whatsoever on uploaded files. I even disabled that module to be sure it wasn't somehow conflicting.

To be clear, this is the road I've tried:

  • All roles have access to "view uploaded files"
  • Only the "member" role has access to "access private download directory"

This is just using straight FTP uploads. No Filefield involvement here. I've updated as well to 1.2.

johnhanley’s picture

It's gotta be something to do with your particular configuration because if this problem was so widespread everybody would be complaining and nobody would be using Private Download successfully.

The fact that only user #1 can download a file suggests to me that another module is overriding the permission provided by Private Download. Try temporarily disabling Content Access and then see if it works.

webkenny’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Closed (works as designed)

Indeed it appears the Gallery Assist module for some unexplained reason in an old version (1.11) was passing -1 further up the chain than Private Download. Sorry for the unintended fire alarm, there.

Might make for an interesting patch if Private Download was in debug mode and could report on something preventing it from executing. Imagine the fewer issues you'd get in queue.

Nice work on this. Very easy to work with when something else isn't standing in it's way. ;)

johnhanley’s picture

That's good news, Kenny.

You're right, the permissions issues does crop up from time to time. I do wonder if there's a way to determine if another module is muscling in on Private Download's permission.

wsitch’s picture

I can't believe it. I've been banging my head against this for TWO days. I had the same problem as webkenny. User #1 can download a private file, others can't regardless of permissions. I've cleared caches, rebuilt permissions, removed/added FileField Permissions, Content Access, ACL, etc etc etc. No dice.

I just figured it out. There's a module out there called "Backup and Migrate". If the user has permissions to "access backup files", then they can download a private file if the other permissions line up. Otherwise they can't. Grrr.

Heads up, don't just be wary of Gallery Assist, watch out for this stupid "Backup and Migrate" module too!

wsitch’s picture

This was also causing me to (falsely) believe that if I had CCK FileField "Content Permissions" module enabled, I was unable to simply FTP files into the private directory and download them blind.

I had convinced myself I was going to have to use the new CCK content type (with new private CCK file field attached) to upload files one at a time.

The $denied == TRUE being set by Backup and Migrate was killing me on so many different levels.

johnhanley’s picture

@wsitch,

Thanks for your posts. I wasn't aware Backup and Migrate could wreak such havoc with access permissions either. Ironically I just downloaded Backup and Migrate a few minutes ago, but thankfully the intended project doesn't also use Private Download. :-)

Anyway, hopefully this information will save others some time.

John

webkenny’s picture

Title: role cannot download file from private folder » Role Cannot Download from Private Folder due to Module Access Conflicts
Assigned: Unassigned » webkenny
Status: Closed (works as designed) » Needs work

BM,

If you don't mind I am going to try my hand at some form of a notification that might help folks identify which modules could be affecting their ability to use this module. e.g. a debug mode. As far as I'm concerned this is one of the more useful ones in the community so I'm willing to assist. I'll see what I can do in the way of a patch here in the next couple of weeks.

We'll look at it and see if maybe it's something to be included in a future release.

-K

webkenny’s picture

Category: support » feature

Categorizing this properly.

johnhanley’s picture

webkenny, that would be awesome!

I'm looking forward to hearing your findings.

John

ikeigenwijs’s picture

i also have some problems see issue.
i removed backup migrate, but this did not help.
http://drupal.org/node/1024406

anrikun’s picture

johnhanley’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Closing due to Drupal 6 end-of-life cycle.