[SOLVED]Trouble getting V6 Security by Group Working

Well I used the v6 security to create the security in my application it seem that this code is not working and I can’t figure it out. IF someonce can post some code that will work would be great.

sc_lookup (dataset, “select user_group from staff_listing where login = ‘[usr_login]’”);

$user_group = {dataset [0][0]};

$sql = “SELECT
app_name,
priv_access,
priv_insert,
priv_delete,
priv_update,
priv_export,
priv_print
FROM sec_groups_apps
WHERE group_id = $user_group”;

//sc_apl_status (‘sec_menu’,‘on’);

sc_select(rs, $sql);
if ({rs} !== true);
{
while (!$rs->EOF)
{
if( $rs->fields[1] == ‘Y’ ||
$rs->fields[2] == ‘Y’ ||
$rs->fields[3] == ‘Y’ ||
$rs->fields[4] == ‘Y’ ||
$rs->fields[5] == ‘Y’ ||
$rs->fields[6] == ‘Y’)
{
sc_apl_status($rs->fields[0], ‘on’);
}
else
{
sc_apl_status($rs->fields[0], ‘off’);
}

	sc_apl_conf($rs->fields[0], 'access', has_privd($rs->fields[1]));
	sc_apl_conf($rs->fields[0], 'insert', has_privd($rs->fields[2]));
	sc_apl_conf($rs->fields[0], 'delete', has_privd($rs->fields[3]));
	sc_apl_conf($rs->fields[0], 'update', has_privd($rs->fields[4]));
	//export
	$export_permission = 'btn_display_'. has_privd($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_privd($rs->fields[6]);
	sc_apl_conf($rs->fields[0], $export_permission, 'print');

	$rs->MoveNext();	
}
$rs->Close();

sc_redir('sec_menu');	

}

Re: Trouble getting V6 Security by Group Working

what is the problem, what is not working …

Re: Trouble getting V6 Security by Group Working

The problem is it does not seem to setting the user privileges properly. - applications are not being activated that should be.

Re: Trouble getting V6 Security by Group Working

I am sure that is only for user, who are member of more than one group, or?
The security system only sets the privileges for one group.