Closed (works as designed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jun 2014 at 16:40 UTC
Updated:
9 Jun 2014 at 19:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joseph.olstadsee patch
Comment #2
joseph.olstadComment #3
joseph.olstadEdit 7226 so as to not break other patches after the introduction of this problem (there's already a 7227 in another patch) , just fix this 7226 once for the next release as there is a workaround noted in the description of this issue.
BEFORE
NEW CODE (had to test it as a higher number 722x for testing increase x as number desired/required for drush updatedb to pick it up)
Comment #4
devin carlson commentedThe
administer media browserpermission is used to grant users the ability to configure the backend media browser settings. It does does not grant users the ability to use the media browser.Prior to #2048359: Select Media Browser need other permissions., in order for a user to access the media browser, they needed to pass
file_entity_access('create')which is true if users had thecreate filespermission. That's why the upgrade script grants the newaccess media browserpermission to users who have thecreate filespermission.Comment #5
joseph.olstadOk, while the role 'create files' for the 'file_entity' module makes sense , the value "false" passed as a parameter to "user_roles" might be what is causing our problem.
drupal api page
So, we should be passing "true" as a parameter instead of "false" as we don't want anonymous users to have access to the media browser (at least not by default).
Also, it does make sense that users that have 'administer media browser' permissions should be able to 'access media browser' but in our case (wetkit distro v1.5) we get 'access denied' when clicking the media browser button until the permissions are manually assigned through the admin interface.
How about if both were copied? 'create files' and 'administer media browser' just to make sure (and it would help us not have to make our own update hook outside of the media module)?
Comment #6
joseph.olstadThanks for the quick response.
ok, I did some more testing, in our distro the hook never gets fired, most likely because we're using various versions of patched media modules and it's likely that the update_7226 was already triggered by a different version that didn't actually update the permissions correctly. I tested by cleaning my db, reloading to a baseline and then changing the update_7226 to update_7228 , I'll have to check the schema table to verify, but it looks like our schema was at update_7227 , so the update_7226 must have been fired previously with a different patch and therefore never actually copied any permissions as it did something else with a previous patch code.
I'll close this again, it's on our distro side obviously. Although using the "true" parameter wouldn't hurt.
Thanks