Menu restriction access

Hi,
i need to manage my menu application after logging.
so i have a login application and a menu application.In the login application i write this code on validateSuccess event:


$sql = "SELECT 
		app_name,
		priv_access,
		priv_insert,
		priv_delete,
		priv_update,
		priv_export,
		priv_print
	      FROM dbo.sec_groups_apps
	      WHERE group_id IN
	          (SELECT
		       group_id
		   FROM
		       dbo.sec_users_groups 
		   WHERE
		       login = '". [usr_login] ."')";

	
sc_select(rs, $sql);
if ({rs} !== false)
{
	
	while (!$rs->EOF)
	{
			
		if( $rs->fields[1] == 'Y')
		{
		  	
			sc_apl_status($rs->fields[0], 'on');
			
		}
		else
		{
		    sc_apl_status($rs->fields[0], 'off');
		}

		sc_apl_conf($rs->fields[0], 'insert', has_priv($rs->fields[2]));
		sc_apl_conf($rs->fields[0], 'delete', has_priv($rs->fields[3]));
		sc_apl_conf($rs->fields[0], 'update', has_priv($rs->fields[4]));
		//export
		$export_permission = 'btn_display_'. has_priv($rs->fields[5]);
		sc_apl_conf($rs->fields[0], $export_permission, 'xls');
		sc_apl_conf($rs->fields[0], $export_permission, 'word');
		sc_apl_conf($rs->fields[0], $export_permission, 'pdf');
		sc_apl_conf($rs->fields[0], $export_permission, 'xml');
		sc_apl_conf($rs->fields[0], $export_permission, 'csv');
		sc_apl_conf($rs->fields[0], $export_permission, 'rtf');
		//export
		
		$export_permission = 'btn_display_'. has_priv($rs->fields[6]);
		sc_apl_conf($rs->fields[0], $export_permission, 'print');

		$rs->MoveNext();	
	}
	$rs->Close();
	
		sc_log_add('login', {lang_login_ok});
		
		sc_redir('menu');	
	
}

but the menu application appears wthi all menuItem,can you help me to hide items coorectly ? thx

H,
just i use the sc-security module, and check:
Options->my scriptcase enable use of security & enable use of password
you would see every menu item as enabled.

Use sc_menu_delete() if you would not display menu items …