English 中文(简体)
“DOMAINdomain”用户的UserHavePermission作假
原标题:DoesUserHavePermissions returns false for "DOMAINdomain users"
  • 时间:2009-12-10 20:52:16
  •  标签:
  • sharepoint

非常奇怪的对冲案件,非常ple。 我拥有一个网站服务,这份网站导游名单的许可清单。 确定用户是否允许进入第1站点,使用以下代码。

[WebMethod]
        public GetSiteListPermissionsResponseCollection GetSiteListPermissions(string[] siteList)
        {
            GetSiteListPermissionsResponseCollection siteListReturn = new GetSiteListPermissionsResponseCollection();
            foreach (string key in siteList)
            {
                string escapedKey = Uri.EscapeUriString(key);
                if (Uri.IsWellFormedUriString(escapedKey, UriKind.Absolute))
                {
                    bool originalCatchValue = SPSecurity.CatchAccessDeniedException;
                    SPSecurity.CatchAccessDeniedException = false;
                    try
                    {
                        using (SPSite site = new SPSite(escapedKey, SPContext.Current.Site.SystemAccount.UserToken))
                        {
                            using (SPWeb web = site.OpenWeb())
                            {
                                siteListReturn.Add(new GetSiteListPermissionsResponse(key, web.DoesUserHavePermissions(SPContext.Current.Web.CurrentUser.LoginName, SPBasePermissions.Open).ToString()));
                            }
                        }
                    }
                    catch
                    {
                        siteListReturn.Add(new GetSiteListPermissionsResponse(key, false.ToString()));
                    }
                    finally
                    {
                        SPSecurity.CatchAccessDeniedException = originalCatchValue;
                    }
                }
            }
            return siteListReturn;
        }

这一工作做得相当好,但我们陷入了一种非常奇怪的情况,即UserHavePermissions返回法尔。 如果使用“DOMAINdomain”用户提供上网的机会,那么这种结果就是假的。 所有其他地点似乎都做了罚款。

你可以直接增加用户,而且当用户能够进入时即立即返回,但出于某种原因,这个网站和这个网站在使用“主要用户”来提供无障碍用具时,不会恢复真正的反应。

任何杂质?

问题回答

除了有可能成为一个当地混淆的问题外,我试图称之为SPSite。WebWeb,而不是SPSite.OpenWeb()。

(根据一项评论,铭记,视工地工地长长短,这可能是缓慢的,会产生许多非银圆点。)





相关问题
SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

UI automated testing within SharePoint

I m looking for automated Functional Testing tools that can manipulate SharePoint sites, libraries, and documents thought the web interface. It needs to be extensible enough to handle any custom ...

Enable authorization on sitemap provider

I want to enable Authorization on the Site map provider. We have enabled anonymous access to the site and we want the Site map provider to be visible only to authorized users. I tried ...

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...

热门标签