@@ -90,6 +90,45 @@ } + +/** + * Implementation of hook_menu_alter() + */ +function taxonomy_csv_menu_alter(&$items){ + //Add own permission to the import taxonomy option + $items['admin/content/taxonomy/csv_import']['access callback'] = 'ur_ecr_import_taxonomy_import_access'; + $items['admin/content/taxonomy/csv_import']['access arguments'] = array(); + //Add own permission to the export taxonomy option + $items['admin/content/taxonomy/csv_export']['access callback'] = 'ur_ecr_import_taxonomy_export_access'; + $items['admin/content/taxonomy/csv_export']['access arguments'] = array(); +} + +/** + * + * Implementation of hook_perm() + * + */ +function ur_ecr_import_perm(){ + return array('CSV taxonomy import', 'CSV taxonomy export'); +} + +/** + * Access function for taxonomy import + * @return boolean return TRUE if the user is admin or has CSV taxonomy import permission + */ +function ur_ecr_import_taxonomy_import_access(){ + global $user; + return (($user->uid == 1) || user_access('CSV taxonomy import')); +} + +/** + * Access function for taxonomy export + * @return boolean return TRUE if the user is admin or has CSV taxonomy export permission + */ +function ur_ecr_import_taxonomy_export_access(){ + global $user; + return (($user->uid == 1) || user_access('CSV taxonomy export')); +} + /** * Menu callback of the main import form. */ function taxonomy_csv_form_import_prepare() {