Board Logo

How to hide some menu items
Khaled - 3/19/2007 at 07:56 AM

In menu_items.js, I have add to sub menu items a third field which is the function code (F1 and F2):

var MENU_ITEMS = [
['Menu 1', null, null,
['Add Company', 'AddComp.jsp', 'F1'],
['Add User', 'AddUser.jsp', 'F2']
]
];

When the user log in the system, i get his function rights as an array. for example : user1 has the rights [F1,F3,F10]
So he dont have the right to access the function F2 (Add User)
I want to hide this menu item ['Add User', 'AddUser.jsp', 'F2']

What I'm trying to do is:
Check if the function field 'F2' exists in the rights array which i got from DB, it should be displayed, otherwise it should be hidden.
I go thru Menu.js and tryed to manage this issue but i could not!!

and if you another idia to manage it, please help me.

Thanks in advance :)


Khaled - 3/19/2007 at 11:52 AM

I did this modification in
Menu.js >> menu_item(o_parent,n_order) >> line 275 (init downline recursively)

I access the function field 'F1' using : this.a_config[n_order][2]
Then I compare it whth user function rights elements

and by the way, in it's for loop I remove "-3" from the statment

it works fine :)


madhan - 7/10/2007 at 07:26 AM

hai
i am haveing the same problem
but i am a beginer .plz send me the code and explain it
so it will help me a lot
thanks in advance


Quote:
Originally posted by Khaled
I did this modification in
Menu.js >> menu_item(o_parent,n_order) >> line 275 (init downline recursively)

I access the function field 'F1' using : this.a_config[n_order][2]
Then I compare it whth user function rights elements

and by the way, in it's for loop I remove "-3" from the statment

it works fine :)


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/