Javascript菜单用户权限 [英] Javascript Menu User rights

查看:98
本文介绍了Javascript菜单用户权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有Javascript菜单,有人可以告诉如何授予菜单用户权限吗?例如,如果admin已登录,则菜单应显示所有选项;如果普通用户已登录,则菜单将显示有限的选项.全部使用WEB.CONFIG.

Hi ,

I have Javascript menu, can anyone tell how to give user rights for menu? like if admin is logged in then menu should shows all option and if normal user has logged in then it will show limited options. All using WEB.CONFIG.

推荐答案

好,您要做的就是
1.基于Web.config获取要显示的菜单项
2.根据获取的菜单项,在运行时创建菜单
3.使用此运行时创建的菜单并显示它

其他方式:
1.列出菜单项(所有菜单项-全部相同)
2.基于Web.Config,找到给定角色的可访问菜单项
3.根据当前用户角色,启用/禁用菜单项.

试试吧!
Well, all you need to do is,
1. based on Web.config fetch the Menu items to be displayed
2. based on the menu items fetched, create menu at runtime
3. use this runtime created menu and display it

Other way:
1. Have a list of menu items (all of them - same for all)
2. based on Web.Config, find the menu items accessbile for a given role
3. based on current users role, enable/disable the menu items.

Try!


这篇关于Javascript菜单用户权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆