diff --git a/media.module b/media.module index 4ef9f00..c2db72d 100644 --- a/media.module +++ b/media.module @@ -158,8 +158,8 @@ function media_menu() { 'title' => 'Media browser', 'description' => 'Media Browser for picking media and uploading new media', 'page callback' => 'media_browser', - 'access callback' => 'media_access', - 'access arguments' => array('view'), + 'access callback' => 'file_access', + 'access arguments' => array('create'), 'type' => MENU_CALLBACK, 'file' => 'includes/media.browser.inc', 'theme callback' => 'media_dialog_get_theme_name', @@ -181,8 +181,8 @@ function media_menu() { 'description' => 'Choose a format for a piece of media', 'page callback' => 'drupal_get_form', 'page arguments' => array('media_format_form', 1), - 'access callback' => 'media_access', - 'access arguments' => array('view'), + 'access callback' => 'file_access', + 'access arguments' => array('view', 1), 'file' => 'includes/media.filter.inc', 'theme callback' => 'media_dialog_get_theme_name', 'type' => MENU_CALLBACK, @@ -195,8 +195,7 @@ function media_menu() { 'title' => 'Edit multiple files', 'page callback' => 'media_file_page_edit_multiple', 'page arguments' => array(4), - 'access callback' => 'media_access', - 'access arguments' => array('edit'), + 'access arguments' => array('edit any files'), 'file' => 'includes/media.pages.inc', ); } @@ -207,8 +206,8 @@ function media_menu() { 'title' => 'Edit', 'page callback' => 'drupal_get_form', 'page arguments' => array('media_file_edit_modal', 1, 3), - 'access callback' => 'media_access', - 'access arguments' => array('edit'), + 'access callback' => 'file_access', + 'access arguments' => array('update', 1), 'file' => 'includes/media.pages.inc', 'type' => MENU_CALLBACK, ); @@ -578,7 +577,7 @@ function media_browser_form_submit($form, &$form_state) { if (!empty($url)) { // We the user has access to edit media, we change the redirect to the file-edit url // first, then secondly to the destionation decided above. - if (media_access('edit')) { + if (file_access('update', $parameters['query']['fid'])) { $destination = $url . '?' . drupal_http_build_query($parameters['query']); $url = media_file_edit_url($parameters['query']['fid']); $parameters = array('query' => array('render' => 'media-popup', 'destination' => $destination));