Khaled
Junior Member
Posts: 4
Registered: 3/19/2007
Location: Riyadh
Member Is Offline
|
| posted on 3/19/2007 at 07:56 AM |
|
|
How to hide some menu items
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
Junior Member
Posts: 4
Registered: 3/19/2007
Location: Riyadh
Member Is Offline
|
| posted on 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
Newbie
Posts: 1
Registered: 7/10/2007
Location: chennai
Member Is Offline
|
| posted on 7/10/2007 at 07:26 AM |
|
|
explain
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 :) |
|
|
|
|