Skip to content

Instantly share code, notes, and snippets.

@opi
Created August 10, 2012 11:13
Show Gist options
  • Save opi/3313478 to your computer and use it in GitHub Desktop.
Save opi/3313478 to your computer and use it in GitHub Desktop.
Mimic user_edit_access for views page
<?php
// For a view with user/%/foo path
// My module must have a weight greater than views (ex:11)
function mymodule_menu_alter(&$items){
$items['user/%views_arg/foo']['access callback'] = 'mymodule_edit_access';
$items['user/%views_arg/foo']['access arguments'] = array(1);
}
function mymodule_edit_access($arg) {
return user_edit_access(user_load($arg));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment