本文介绍了登录用户可以访问给定URL后面的签入代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想检查登录用户可访问的URL.

详细信息:我正在为带有安全调整功能的自定义菜单创建一个Web部件.菜单项从自定义列表中填充.我想从列表中获取每个项目,检查其url(当前用户是否可以访问它),如果是,则将此行添加到新的数据表中,最后将此数据表绑定到我的controller(datalist).

例如

Hi,

I want to check the url accessible for the logged in user.

In Detail: I am creating a web part for custom menu with security trimming. Menu Items are populating from a custom list. I want to fetch each item from the list, Check its url (whether it is accessible for the current user), if yes add this row to a new datatable and at last bind this datatable to my controller(datalist).

Eg.

foreach (ListItem item in listitemCollection)
{
    string url = item["pageurl"]

    if (Url is accessable) //<<==Need a code for this
    {
        Add url to a datatable
    }    
}



我不知道这种方法是否正确.如果您还有其他想法可以实现,请分享.



I don''t know whether this approach is right. If you have any other idea to achieve this please share.

推荐答案


这篇关于登录用户可以访问给定URL后面的签入代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 14:01