本文整理汇总了C#中CurrentUserInfo.IsGroupAdministrator方法的典型用法代码示例。如果您正苦于以下问题:C# CurrentUserInfo.IsGroupAdministrator方法的具体用法?C# CurrentUserInfo.IsGroupAdministrator怎么用?C# CurrentUserInfo.IsGroupAdministrator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurrentUserInfo
的用法示例。
在下文中一共展示了CurrentUserInfo.IsGroupAdministrator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
cu = MembershipContext.AuthenticatedUser;
// Check 'Manage' permission
if (!cu.IsGroupAdministrator(mGroupId) && !MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.groups", CMSAdminControl.PERMISSION_MANAGE))
{
RedirectToAccessDenied("cms.groups", CMSAdminControl.PERMISSION_MANAGE);
}
messageEditElem.AdvancedMode = true;
messageEditElem.MessageID = mMessageId;
messageEditElem.MessageBoardID = mBoardId;
messageEditElem.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(messageEditElem_OnCheckPermissions);
messageEditElem.OnBeforeMessageSaved += new OnBeforeMessageSavedEventHandler(messageEditElem_OnBeforeMessageSaved);
messageEditElem.OnAfterMessageSaved += new OnAfterMessageSavedEventHandler(messageEditElem_OnAfterMessageSaved);
// initializes page title control
if (mMessageId > 0)
{
PageTitle.TitleText = GetString("Board.MessageEdit.title");
}
else
{
PageTitle.TitleText = GetString("Board.MessageNew.title");
}
if (!URLHelper.IsPostback())
{
messageEditElem.ReloadData();
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
cu = CMSContext.CurrentUser;
// Check 'Manage' permission
if (!cu.IsGroupAdministrator(mGroupId) && !CMSContext.CurrentUser.IsAuthorizedPerResource("cms.groups", CMSAdminControl.PERMISSION_MANAGE))
{
RedirectToAccessDenied("cms.groups", CMSAdminControl.PERMISSION_MANAGE);
}
messageEditElem.AdvancedMode = true;
messageEditElem.MessageID = mMessageId;
messageEditElem.MessageBoardID = mBoardId;
messageEditElem.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(messageEditElem_OnCheckPermissions);
messageEditElem.OnBeforeMessageSaved += new OnBeforeMessageSavedEventHandler(messageEditElem_OnBeforeMessageSaved);
messageEditElem.OnAfterMessageSaved += new OnAfterMessageSavedEventHandler(messageEditElem_OnAfterMessageSaved);
// initializes page title control
if (mMessageId > 0)
{
CurrentMaster.Title.TitleText = GetString("Board.MessageEdit.title");
CurrentMaster.Title.TitleImage = GetImageUrl("Objects/Board_Message/object.png");
}
else
{
CurrentMaster.Title.TitleText = GetString("Board.MessageNew.title");
CurrentMaster.Title.TitleImage = GetImageUrl("Objects/Board_Message/new.png");
}
CurrentMaster.Title.HelpTopicName = "messages_edit";
CurrentMaster.Title.HelpName = "helpTopic";
if (!URLHelper.IsPostback())
{
messageEditElem.ReloadData();
}
}
示例3: SetupControl
//.........这里部分代码省略.........
lnkJoinGroup.Attributes.Add("onclick", "JoinToGroupRequest();return false;");
lnkJoinGroup.NavigateUrl = URLHelper.CurrentURL;
}
else
{
lnkJoinGroup.NavigateUrl = GetUrl(JoinGroupPath);
}
pnlJoinGroup.Visible = true;
pnlGroupLinks.Visible = true;
}
else if ((gmi.MemberStatus == GroupMemberStatus.Approved) || (CMSContext.CurrentUser.IsGlobalAdministrator))
// Display Leave the group link if user is the group member
{
if (String.IsNullOrEmpty(LeaveGroupPath))
{
script += "function LeaveTheGroupRequest() {\n" +
"modalDialog('" + CMSContext.ResolveDialogUrl("~/CMSModules/Groups/CMSPages/LeaveTheGroup.aspx") + "?groupid=" + currentGroup.GroupID + "','requestLeaveThGroup', 500, 180); \n" +
" } \n";
lnkLeaveGroup.Attributes.Add("onclick", "LeaveTheGroupRequest();return false;");
lnkLeaveGroup.NavigateUrl = URLHelper.CurrentURL;
}
else
{
lnkLeaveGroup.NavigateUrl = GetUrl(LeaveGroupPath);
}
pnlLeaveGroup.Visible = true;
pnlGroupLinks.Visible = true;
}
}
// Display Manage the group link if set so and user is logged as group administrator and user is visiting a group page
if (DisplayManageGroup && (currentUser.IsGroupAdministrator(currentGroup.GroupID) || (currentUser.IsGlobalAdministrator)))
{
lnkManageGroup.NavigateUrl = ResolveUrl(TreePathUtils.GetUrl(GroupInfoProvider.GetGroupManagementPath(currentGroup.GroupName, CMSContext.CurrentSiteName)));
pnlManageGroup.Visible = true;
pnlGroupLinks.Visible = true;
}
}
if (DisplayInviteToGroup)
{
// Get group info from community context
GroupInfo currentGroup = CommunityContext.CurrentGroup;
// Get user info from site context
UserInfo siteContextUser = SiteContext.CurrentUser;
// Display invite to group link for user who is visiting a group page
if (currentGroup != null)
{
// Get group user
if (gmi == null)
{
gmi = GetGroupMember(CMSContext.CurrentUser.UserID, currentGroup.GroupID);
}
if (((gmi != null) && (gmi.MemberStatus == GroupMemberStatus.Approved)) || (CMSContext.CurrentUser.IsGlobalAdministrator))
{
pnlInviteToGroup.Visible = true;
if (String.IsNullOrEmpty(InviteGroupPath))
{
script += "function InviteToGroup() {\n modalDialog('" + CMSContext.ResolveDialogUrl("~/CMSModules/Groups/CMSPages/InviteToGroup.aspx") + "?groupid=" + currentGroup.GroupID + "','inviteToGroup', 500, 345); \n } \n";
lnkInviteToGroup.Attributes.Add("onclick", "InviteToGroup();return false;");
lnkInviteToGroup.NavigateUrl = URLHelper.CurrentURL;