Issue to track necessary changes once #1227706: Add a file entity access API goes in. Initial patch simply changes the upload plugin to use the new function.

Files: 
CommentFileSizeAuthor
#10 media-file-access-1677054-10.patch2.99 KBgooddesignusa
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-file-access-1677054-10.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#8 media-file-access-1677054-08.patch2.95 KBjhedstrom
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#5 media-file-access-1677054-5.patch2.46 KBJackinloadup
FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: run-tests.sh reported no tests were found. See review log for details..
[ View ]
#2 media-file-access-1677054-2.patch3.79 KBJackinloadup
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#1 media-file-access-1677054-01.patch3.65 KBjhedstrom
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
media-file-access.patch510 bytesjhedstrom
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Comments

jhedstrom’s picture

Status:Needs work» Needs review
StatusFileSize
new3.65 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Replacing a few more instances of media_access with file_access.

Jackinloadup’s picture

StatusFileSize
new3.79 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

fixed some hook_menu arguments

jpstrikesback’s picture

Tested uploads, working great

gooddesignusa’s picture

This patch doesn't seem to apply to the latest dev of 2012-Aug-25.
If you use http://drupalcode.org/project/media.git/tree/1a0304dc62a468cf3fef7559cd6...
the patch applies cleanly.

Jackinloadup’s picture

StatusFileSize
new2.46 KB
FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: run-tests.sh reported no tests were found. See review log for details..
[ View ]

all the changes are due to #1293908: Respect file type restrictions in media browser library view getting in ^_^

attached is a here is a reroll

I changed all the places where we asked for 'edit' privileges to 'update'

Jackinloadup’s picture

Status:Needs review» Postponed

I'm going to mark this as postponed as we can't do reviews until #1227706: Add a file entity access API is in anyway.

gooddesignusa’s picture

Thanks for rerolled patch. It seems that upload tab for the media browser still wont show unless the user has the permission 'Administer files'. I verified I did apply the file_entity-file-access-1227706-71.patch from the other thread. I did notice there was a newer patch. I reversed the above patch and applied file_entity-file-access-1227706-78.patch. I also applied the patch from http://drupal.org/node/1422260#comment-6415726. Flushed cache and still no luck.

jhedstrom’s picture

StatusFileSize
new2.95 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Patch from #5 still had a lingering call to media_access() in MediaBrowserUpload.

jpstrikesback’s picture

Status:Postponed» Needs review

Let's get #8 tested (changing status)

gooddesignusa’s picture

StatusFileSize
new2.99 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-file-access-1677054-10.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

file_access needed to be updated to file_entity_access. The naming got changed a couple patches ago.
I did test it the latest patch http://drupal.org/node/1227706#comment-6627060 and it seems to be working.
I manually edited the patch and swapped out file_access, should still work fine. I've never manually edited a .patch file before.

ParisLiakos’s picture

Title:Use file_access() instead of media_access()» Use file_entity_access() instead of media_access()
Status:Needs review» Fixed

thanks all, commited with some changes

Status:Fixed» Closed (fixed)

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

David_Rothstein’s picture

The changes on commit look like they introduced a bug; see #1877214: Media browser upload plugin permission check is incorrect.