I cannot upload an image as a user with the following permissions:

edit captions
mass upload images
view imagefield uploads
administer nodes

I have tried this on both FF3 and Google Chrome, and I get the same results. It works for user1, but not for a user with the above perms.

I have flushed the site's cache as well as both browser's cache, all while logging out as well, and nothing helped.

I am using the dev from 2009-Mar-15.

CommentFileSizeAuthor
#2 403726_1.png11.19 KBmrthumpz
#2 403726_2.png6.99 KBmrthumpz

Comments

demm’s picture

Category: bug » support

Make sure your "File system path" and "Temporary directory" (/admin/settings/file-system) are both writable by the webserver.

If you have CCK's content_permission module activated, you also need to set "edit field_images" (or whatever your imagefield is called).

What exactly do you see when you try to upload the images? (Take a screenshot if possible)

mrthumpz’s picture

StatusFileSize
new6.99 KB
new11.19 KB

Yes they are both writable, and they work for user1.

No, I don't have the content_permission module enabled.

Attached are screenshots - the first represents what it appears like after the upload bar progresses across the screen (Error 403), the next item starts to upload, but they will all get the same error. The second image is how it appears after waiting for each image to fail.

grandcat’s picture

(Something has to be wrong with your server settings, because I did not change anything concerning the flash uploader.)

Another reason could be, that I changed some theming related stuff what means that you have to reinstall image fupload and its submodules because the data which needs flash to access to the server, changed.

mrthumpz’s picture

How could it be server settings if it is working for user1?

Ok, I installed a fresh Drupal site, an re-downloaded the module and the swfuploader.

It is still doing the same thing, here is what is entered in the log when this is occuring:

Type access denied
Date Monday, March 16, 2009 - 22:38
User todd (this is not the admin)
Location http://test2.iplanitglobal.com/fupload/flash
Referrer
Message fupload/flash
Severity warning
Hostname 72.241.207.9
Operations

What else is interesting is if I click on that /fupload/flash link as an admin, it tells me access denied and logs me out.

Any other ideas?

robertdjung’s picture

I'm getting this error, too. I have un-installed and re-installed. Same as first user, User#1 admin account works flawlessly. Any other user doesn't.

mrthumpz’s picture

good to hear someone else was having the problem too...

I feel like I'm taking crazy pills!

-Mugatu

demm’s picture

Do you use any kind of access module (i.e. taxonomy access)? Try rebuilding your permissions (/admin/content/node-settings).
If that doesn't help, try disabeling that module.

It could also have something to do with caching. If you use it, disable it and flush all cashes.

mrthumpz’s picture

I figured out what the issue was. For the user I was using, I granted them administer nodes permission, but none of the create, delete, edit permissions specific to each content type. It worked when I gave the user 'create photo_gallery content' permission.

This shouldn't have to be required - 'administer nodes' should trump all those settings.

demm’s picture

Title: Upload Error: 403 - all permissions set correctly and works for admin » Permission 'administer nodes' should allow image uploading
Category: support » bug
Priority: Normal » Minor

You're right, 'administer nodes' should give full access, but the module only checks against 'create images' or 'create '.$node_type.' content'.

This should be considered a bug.

mrthumpz’s picture

Title: Permission 'administer nodes' should allow image uploading » 'administer nodes' permission does not override 'create *** content' permission
Priority: Minor » Normal
mrthumpz’s picture

Title: 'administer nodes' permission does not override 'create *** content' permission » Permission 'administer nodes' should allow image uploading

sorry - we saved at the same time

grandcat’s picture

Status: Active » Postponed (maintainer needs more info)

I don't think it's a bug. It's more a setting related issue which should not be a topic of image_fupload.

mrthumpz’s picture

Referencing: http://drupal.org/node/132202

administer nodes
Allows the user to create, edit, and delete nodes of all types. This overrides all the create/edit own/edit options for specific content types below. This also exposes the 'Publishing options' section when editing nodes, allowing users to promote content to the front page, publish and unpublish, make sticky, and create new revisions.
grandcat’s picture

Status: Postponed (maintainer needs more info) » Postponed

OK, thank you, I will change this in a future update.

demm’s picture

Status: Postponed » Postponed (maintainer needs more info)

Well, I'm pretty new to drupal, but I think where your module has:
$field_access = user_access('create ' .$node_type. ' content', $user);
it should read:
$field_access = node_access('create', $node_type, $user);

node_access() will first do some checks (e.g. if 'administer nodes' is set) before invoking the module's (in this case CCK's) access hook.

I tried this change at my local test system and it worked like expected.

demm’s picture

sorry, forgot to refresh the page before submitting

robertdjung’s picture

Status: Postponed (maintainer needs more info) » Postponed

maybe this is changed in DEV, but as of alpha 3 I get the 403 error, even when the permissions are set to create specific node types, and edit the specific field.

grandcat’s picture

@ robertdjung:
A reason could be, that I changed some theming related stuff what means that you have to reinstall image fupload and its submodules because the data which needs flash to access to the server, changed.

@ demm:
Thank you. I didn't know this function, but I will integrate it.

grandcat’s picture

Status: Postponed » Fixed

Fixed in CVS Head.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.