Created
August 10, 2012 11:13
-
-
Save opi/3313478 to your computer and use it in GitHub Desktop.
Mimic user_edit_access for views page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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