Hi,
I used this code. In modify.php insert this code:
// check if user has permissions to access the yourmodulename module
require_once('../../framework/class.admin.php');
$admin = new admin('Modules', 'module_view', false, false);
if (!($admin->is_authenticated() && $admin->get_permission('yourmodulename', 'module')))
die(header('Location: ../../index.php'));
where yourmodulename is your module name (it must be exact as in database)
cheers