当前位置: 首页>>代码示例>>C#>>正文


C# UserInfo.IsInSite方法代码示例

本文整理汇总了C#中UserInfo.IsInSite方法的典型用法代码示例。如果您正苦于以下问题:C# UserInfo.IsInSite方法的具体用法?C# UserInfo.IsInSite怎么用?C# UserInfo.IsInSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserInfo的用法示例。


在下文中一共展示了UserInfo.IsInSite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckUserAvaibleOnSite

 /// <summary>
 /// Test if edited user belongs to current site
 /// </summary>
 /// <param name="ui">User info object</param>
 public void CheckUserAvaibleOnSite(UserInfo ui)
 {
     if (ui != null)
     {
         if (!CMSContext.CurrentUser.IsGlobalAdministrator && !ui.IsInSite(CMSContext.CurrentSiteName))
         {
             RedirectToInformation(GetString("user.notinsite"));
         }
     }
 }
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:14,代码来源:User_ManageRoles.aspx.cs

示例2: VerifyRequestingUser

    /// <summary>
    /// Verifies whether current user has permissions to create a friend-request on behalf of <paramref name="requestingUser"/>
    /// </summary>
    /// <param name="requestingUser">User on behalf of which the friend request is attempted.</param>
    /// <returns>Error message if there is an error. Null otherwise.</returns>
    private string VerifyRequestingUser(UserInfo requestingUser)
    {
        if (!currentUser.IsGlobalAdministrator)
        {
            if (CanApprove())
            {
                if (!requestingUser.IsInSite(SiteContext.CurrentSiteName))
                {
                    return GetString("user.error_doesnoteexist");
                }
            }
            else if (requestingUser.UserID != currentUser.UserID)
            {
                return GetString("friends.error_permission_createfriendsonbehalf");
            }
        }

        return null;
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:24,代码来源:Friends_Request.ascx.cs

示例3: VerifyRequestedUser

    /// <summary>
    /// Verifies whether current user has permissions to send a friend-request to <paramref name="requestedUser"/>
    /// </summary>
    /// <param name="requestedUser">User to which the friend request is being sent.</param>
    /// <returns>Error message if there is an error. Null otherwise.</returns>
    private string VerifyRequestedUser(UserInfo requestedUser)
    {
        if (!currentUser.IsGlobalAdministrator && (requestedUser != null))
        {
            if (!requestedUser.IsInSite(SiteContext.CurrentSiteName)
                    || (requestedUser.UserIsHidden)
                    || (!requestedUser.Enabled)
                    || (requestedUser.UserSettings.UserWaitingForApproval))
            {
                return GetString("user.error_doesnoteexist");
            }
        }

        return null;
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:20,代码来源:Friends_Request.ascx.cs


注:本文中的UserInfo.IsInSite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。