Пример #1
0
        protected override ScriptControlDescriptor GetScriptDescriptor()
        {
            ScriptControlDescriptor scriptDescriptor = base.GetScriptDescriptor();

            scriptDescriptor.Type = "SubscriptionResultWizardStep";
            scriptDescriptor.AddProperty("FailedHelpLink", HelpUtil.BuildEhcHref(OptionsHelpId.AutoProvisionFailed.ToString()));
            scriptDescriptor.AddProperty("NewPopAccessible", LoginUtil.CheckUrlAccess("NewPopSubscription.aspx"));
            scriptDescriptor.AddProperty("NewImapAccessible", LoginUtil.CheckUrlAccess("NewImapSubscription.aspx"));
            return(scriptDescriptor);
        }
Пример #2
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            if (string.IsNullOrEmpty(this.SourceID))
            {
                throw new InvalidOperationException("DetailsPane requires the SourceID parameter to be set");
            }
            Control control = this.NamingContainer.FindControl(this.SourceID);

            if (control != null)
            {
                ListView listView = control as ListView;
                if (listView != null)
                {
                    this.ListViewID = listView.ClientID;
                }
                else
                {
                    EcpCollectionEditor ecpCollectionEditor = control as EcpCollectionEditor;
                    if (ecpCollectionEditor != null)
                    {
                        this.ListViewID = ecpCollectionEditor.ListViewID;
                    }
                }
            }
            if (string.IsNullOrEmpty(this.ListViewID))
            {
                throw new InvalidOperationException(string.Format("Cannot find control that corresponds to SourceID '{0}' passed to the details pane with ID '{1}'. ", this.SourceID, this.ID));
            }
            if (string.IsNullOrEmpty(this.BaseUrl))
            {
                throw new InvalidOperationException("DetailsPane requires the BaseUrl property to be set");
            }
            this.BaseUrl = base.ResolveClientUrl(this.BaseUrl);
            if (string.IsNullOrEmpty(this.FrameTitle))
            {
                throw new InvalidOperationException("DetailsPane requires the FrameTitle property to be set, otherwise there is accessibility issue for screen readers.");
            }
            if (this.TypeMappings.Count != 0)
            {
                foreach (TypeMapping typeMapping in this.TypeMappings)
                {
                    if (string.IsNullOrWhiteSpace(typeMapping.BaseUrl))
                    {
                        throw new InvalidOperationException("BaseUrl in TypeMappings property cannot be empty string");
                    }
                    typeMapping.BaseUrl = base.ResolveClientUrl(typeMapping.BaseUrl);
                    if (typeMapping.InRole == null)
                    {
                        typeMapping.InRole = new bool?(LoginUtil.CheckUrlAccess(typeMapping.BaseUrl));
                    }
                }
            }
        }
Пример #3
0
 protected override void OnPreRender(EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.NavigationUrl))
     {
         string path = base.TargetControl.ResolveClientUrl(this.NavigationUrl);
         if (!LoginUtil.CheckUrlAccess(path))
         {
             Util.MakeControlRbacDisabled(base.TargetControl);
             base.Enabled = false;
         }
     }
     base.OnPreRender(e);
 }
Пример #4
0
 protected override void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
 {
     base.BuildScriptDescriptor(descriptor);
     descriptor.AddComponentProperty("ListView", this.ListViewID, this);
     descriptor.AddScriptProperty("BaseTypeMapping", new TypeMapping
     {
         BaseUrl = this.BaseUrl,
         InRole  = new bool?(LoginUtil.CheckUrlAccess(this.BaseUrl))
     }.ToJsonString(null));
     if (this.TypeProperty != "Type")
     {
         descriptor.AddProperty("TypeProperty", this.TypeProperty);
     }
     if (!string.IsNullOrWhiteSpace(this.ArgumentProperty))
     {
         descriptor.AddProperty("ArgumentProperty", this.ArgumentProperty);
     }
     descriptor.AddScriptProperty("TypeMappings", this.TypeMappings.ToJsonString(null));
     if (this.SuppressFrameCache)
     {
         descriptor.AddProperty("SuppressFrameCache", true);
     }
     descriptor.AddElementProperty("ContentPanel", this.ContentPanelID, true);
     descriptor.AddElementProperty("LoadingDiv", this.LoadingDivID, true);
     descriptor.AddElementProperty("NoPermissionDiv", this.noPermissionDiv.ClientID, true);
     if (this.ShowPaddingPanels)
     {
         descriptor.AddProperty("ShowPaddingPanels", true);
         descriptor.AddElementProperty("TopEmptyPanel", this.TopEmptyPanelID, true);
         descriptor.AddElementProperty("MiddleEmptyPanel", this.MiddleEmptyPanelID, true);
         descriptor.AddElementProperty("BottomEmptyPanel", this.BottomEmptyPanelID, true);
     }
     descriptor.AddElementProperty("Frame", this.FrameID, true);
     descriptor.AddProperty("FrameTitle", this.FrameTitle, true);
     if (this.toolbar != null && this.ShowToolbar)
     {
         descriptor.AddComponentProperty("Toolbar", this.toolbar.ClientID);
     }
 }
Пример #5
0
 public override bool IsAccessibleToUser(IPrincipal user)
 {
     return((this.BypassUrlCheck || LoginUtil.CheckUrlAccess(this.NavigateUrl)) && base.IsAccessibleToUser(user));
 }