Thursday, October 1, 2009

How To Hide BO Model For Normal User

SimpleUser Su = (SimpleUser)SecuritySystem.CurrentUser; if (!Su.IsAdministrator) { Frame.GetController().Action.SetActiveByKey("EditModel", false);} Or Add a Window Controller And wrete Code private void WindowController1_Activated(object sender, EventArgs e) { // Window.ViewChanged += new EventHandler(Window_ViewChanged); } void Window_ViewChanged(object sender, EventArgs e) { IBarManagerHolder template = Window.Template as IBarManagerHolder; SimpleUser Su = (SimpleUser)SecuritySystem.CurrentUser; if (Su.IsAdministrator) { if (template != null && Window.View != null) { foreach (object actionContainer in Window.Template.GetContainers()) { ActionContainerMenuBarItem mn = actionContainer as ActionContainerMenuBarItem; { if (mn != null) { if (mn.Actions.Count > 0) if (mn.Actions[0].Caption == "Edit Model") { mn.Actions[0].SetEnabledByKey("Edit Model", false); }}}}}}}

No comments:

Post a Comment

Mat Table Angular

Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...