hello,
can someone advise me if my code and step below are correct:
I want to delete menu item based on users group.
I have 3 groups:
- administrator
- seller
- buyer
The security module is automatically generated by SC.
FIRST STEP: I put this code below after “$rs->Close();” line in my Login application in the OnValidateSuccess Event:
sc_lookup(rs, “SELECT sec_groups.description
FROM sec_users_groups, sec_groups
WHERE sec_users_groups.login = '”.{login}."’");
[user_group] = {rs[0][0]};
SECOND STEP: I set usr_group to be OUT type in the Global Variable section of my login application.
THIRD STEP: I created a conditional statement in LOAD Event in my Menu Application, here is the statement.
if([user_group]==‘administrator’){
sc_menu_delete(item_1, item2);
}
elseif ([usr_login] ==‘seller’)
{
sc_menu_delete (item_3, item_4);
}
else ([usr_login] ==‘buyer’)
{
sc_menu_delete (item_5);
}
This conditional statement works well for administrator group when access menu item BUT It did not work for seller and buyer group.
Please suggest me what is wrong in my codes and steps above.
Thank You
Subhan