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);
}}}}}}}
Subscribe to:
Post Comments (Atom)
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...
-
CriteriaOperator criteria = new BinaryOperator("Age", 30, BinaryOperatorType.Greater); CriteriaOperator criteria = CriteriaOperato...
-
SortingCollection sc = new SortingCollection(); sc.Add (new SortProperty("field on which you want to sort",DevExpress.Xpo.DB.Sorti...
-
Minification and Uglyfication in Angular Deployement Minification : While building Angular Application white spaces , unused variable , u...
No comments:
Post a Comment