IsAllowedToViewList() public method

public IsAllowedToViewList ( ) : bool
return bool
Ejemplo n.º 1
0
        void InitViews()
        {
            var sec = new ModuleSecurity(ModuleId, TabId, new Components.Settings(Settings));

            switch (ModuleContext.Settings[SettingName.ListOrForm].AsString("Unknown"))
            {
                case "List":
                    LoadControlByKey("List");
                    break;
                case "Form":
                    if (Request.QueryString["show"].AsString() == "records" && sec.IsAllowedToViewList())
                    {
                        LoadControlByKey("List");
                    }
                    else
                    {
                        LoadControlByKey("Edit");
                    }
                    break;

                case "FormAndList":
                    LoadControlByKey("Edit");
                    if (sec.IsAllowedToViewList())
                    {
                        LoadControlByKey("List");
                    }
                    break;
                case "ListAndForm":
                    if (sec.IsAllowedToViewList())
                    {
                        LoadControlByKey("List");
                    }
                    LoadControlByKey("Edit");
                    break;
                default:
                    LoadControlByKey(IsNewModuleInstance() ? "TemplateList" : "List");
                    break;
            }
        }
Ejemplo n.º 2
0
        public void EnsureActionButton()
        {
            var useButtons = Settings.UseButtonsInForm;
            var sec = new ModuleSecurity(ModuleId, TabId, Settings );
            if (sec.IsAllowedToViewList() && Settings.OnlyFormIsShown )
            {
                var url = Globals.NavigateURL(TabId, "", "show=records");
                var title = Localization.GetString("List.Action", LocalResourceFile);
                cmdShowRecords.NavigateUrl = url;
                cmdShowRecords.Text = title;
                cmdShowRecords.Visible = useButtons;
            }

        }