本文整理汇总了C#中ContentAPI.IsARoleMember方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.IsARoleMember方法的具体用法?C# ContentAPI.IsARoleMember怎么用?C# ContentAPI.IsARoleMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentAPI
的用法示例。
在下文中一共展示了ContentAPI.IsARoleMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Init
protected void Page_Init(object sender, System.EventArgs e)
{
// Register CSS
Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronWorkareaCss);
Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronWorkareaIeCss);
Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronFixedPositionToolbarCss);
contentAPI = new ContentAPI();
m_strStyleSheetJS.Text = (new StyleHelper()).GetClientScript();
if (!Utilities.ValidateUserLogin())
{
return;
}
if ((contentAPI.RequestInformationRef.IsMembershipUser == 1 || ! contentAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminPersonalize)) && ! contentAPI.IsAdmin())
{
Response.Redirect((string) ("reterror.aspx?info=" + contentAPI.EkMsgRef.GetMessage("msg login personalize administrator")), true);
return;
}
string action = "";
if (! string.IsNullOrEmpty(Request.QueryString["action"]))
{
action = Request.QueryString["action"];
}
switch (action.ToLower())
{
case "widgetsync":
Workarea_controls_widgetSettings_WidgetSync ctlWidgetSync;
ctlWidgetSync = (Workarea_controls_widgetSettings_WidgetSync)(Page.LoadControl("controls/widgetSettings/WidgetSync.ascx"));
placeHolder.Controls.Add(ctlWidgetSync);
break;
case "widgetedit":
Workarea_controls_widgetSettings_WidgetEdit ctlWidgetEdit;
ctlWidgetEdit = (Workarea_controls_widgetSettings_WidgetEdit) (Page.LoadControl("controls/widgetSettings/WidgetEdit.ascx"));
placeHolder.Controls.Add(ctlWidgetEdit);
break;
default:
Workarea_controls_widgetSettings_WidgetSpace ctlWidgetSpace;
ctlWidgetSpace = (Workarea_controls_widgetSettings_WidgetSpace) (Page.LoadControl("controls/widgetSettings/WidgetSpace.ascx"));
placeHolder.Controls.Add(ctlWidgetSpace);
break;
}
}
示例2: ValidateUserRole
public static bool ValidateUserRole(EkEnumeration.CmsRoleIds roleId, bool redirect)
{
ContentAPI cApi = new ContentAPI();
if (!cApi.IsARoleMember(roleId))
{
if (redirect)
System.Web.HttpContext.Current.Response.Redirect(cApi.AppPath + "login.aspx?fromLnkPg=1", false);
return false;
}
return true;
}