Problem :
I designed many admission groups like SELLER CUSTOMER ADVISOR .
Normally you can define ONE admission group to ONE user.
There is no way to give one user the rights of SELLER AND CUSTOMER at the same time.
Of course you can create an other permission group SEL_CUS (SELLER + CUSTOMER) but if you have a lot of
different permission groups it will get very complicate.
Solution :
So I changed the template commonfunctions.php in the function GetUserPermissions.
In the EDIT form of user i made the field for the admissiongroup as a multiline lookup field.
So afer edit for example the field has the value SELLER,CUSTOMER,ADVISOR
The changed function will now correctly grant the defined permissions of the different permission groups to the logged user.
Hope it helps..
best regards
Uwe Pfeiffer
function GetUserPermissions($table="")
{
global $strTableName;
$result = "";
if(!$table)
$table=$strTableName;
if @BUILDER.strAdminUserID##
if($_SESSION["AccessLevel"] == ACCESS_LEVEL_ADMIN)
$result.= "ADESP";
endif##
$sUserGroup="," . @$_SESSION["GroupID"] .",";
foreach @BUILDER.Tables as @t##
foreach @BUILDER.UserGroups as @u filter @u.strUserName!="<Default>"##
if($table=="##@t.strDataSourceTable s##" && instr($sUserGroup,",##@u.strUserName s##,"))
##if @u.strUserName=="<Guest>" && @t.nSecOptions==ADVSECURITY_VIEW_OWN##
$result.= ""; // guest sees nothing
##else##
$result.= "##@u.TablePermissions[strTableName=@t.strDataSourceTable].strPermissionMask
";
##endif##
endfor##
// default permissions
if($table=="##@t.strDataSourceTable s##")
if @BUILDER.UserGroups[strUserName=="<Default>"].len##
$result.= "##@BUILDER.UserGroups[strUserName=="<Default>"].TablePermissions[strTableName=@t.strDataSourceTable].strPermissionMask##";
elseif @BUILDER.UserGroups.len==0 || @BUILDER.UserGroups.len==1 && @BUILDER.UserGroups[strUserName=="<Guest>"].len==1##
$result.= "ADESP"; // grant all by default
else##
$result.= ""; // grant nothing by default
endif##
endfor##
return $result;
}