本文整理汇总了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"));
}
}
}
示例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;
}
示例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;
}