Example #1
0
 //JLL: 2009/07/28
 public void CreateFeaturePermissionForNewRule(SecurityDB.secRuleRow srr)
 {
     foreach (int id in Enum.GetValues(typeof(atSecurity.SecurityManager.Features)))
     {
         SecurityDB.secPermissionRow spr = (SecurityDB.secPermissionRow)myA.GetsecPermission().Add(srr);
         spr.FeatureId = id;
         //spr.RuleId = srr.RuleId;
     }
 }
Example #2
0
        protected override void AfterAdd(DataRow ddr)
        {
            SecurityDB.secPermissionRow mem = (SecurityDB.secPermissionRow)ddr;
            mem.PermId = myA.PKIDGet("secPermission", 1);

            mem.AllowCreate  = 0;
            mem.AllowExecute = 0;
            mem.OverrideRule = 0;
            mem.ReadLevel    = 0;
            mem.UpdateLevel  = 0;
            mem.DeleteLevel  = 0;
        }
Example #3
0
        private void CloneRule()
        {
            SecurityDB.secRuleRow currRowRef = CurrentRow();
            SecurityDB.secRuleRow srr        = (SecurityDB.secRuleRow)mySecMan.GetsecRule().Add(null);
            srr.RuleName = "Copy of: " + currRowRef.RuleName;
            SecurityDB.secPermissionRow[] currPerms = (SecurityDB.secPermissionRow[])mySecMan.DB.secPermission.Select("RuleId=" + currRowRef.RuleId);

            foreach (SecurityDB.secPermissionRow prm in currPerms)
            {
                SecurityDB.secPermissionRow newPerm = (SecurityDB.secPermissionRow)mySecMan.GetsecPermission().Add(srr);
                newPerm.FeatureId    = prm.FeatureId;
                newPerm.AllowCreate  = prm.AllowCreate;
                newPerm.AllowExecute = prm.AllowExecute;
                newPerm.DeleteLevel  = prm.DeleteLevel;
                newPerm.OverrideRule = prm.OverrideRule;
                newPerm.ReadLevel    = prm.ReadLevel;
                newPerm.UpdateLevel  = prm.UpdateLevel;
            }

            secRuleBindingSource.Position = secRuleBindingSource.Find("RuleId", srr.RuleId);
        }
Example #4
0
        private void secRuleGridEX_LoadingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            if (e.Row.RowType == Janus.Windows.GridEX.RowType.Record)
            {
                if (e.Row.Table.Key == "FK_secPermission_secRule")
                {
                    SecurityDB.secPermissionRow spr = (SecurityDB.secPermissionRow)((DataRowView)e.Row.DataRow).Row;
                    if (spr.RowState == DataRowState.Added)
                    {
                        e.Row.Cells["State"].Value = 1;
                    }
                    else if (spr.RowState == DataRowState.Modified)
                    {
                        e.Row.Cells["State"].Value = 2;
                    }
                    else
                    {
                        e.Row.Cells["State"].Value = 0;
                    }
                }

                if (e.Row.Table.Key.ToUpper() == "SECRULE")
                {
                    SecurityDB.secRuleRow spr = (SecurityDB.secRuleRow)((DataRowView)e.Row.DataRow).Row;
                    if (spr.RowState == DataRowState.Added)
                    {
                        e.Row.Cells["State"].Value = 1;
                    }
                    else if (spr.RowState == DataRowState.Modified)
                    {
                        e.Row.Cells["State"].Value = 2;
                    }
                    else
                    {
                        e.Row.Cells["State"].Value = 0;
                    }
                }
            }
        }
Example #5
0
 private void secRuleGridEX_ColumnButtonClick(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e)
 {
     try
     {
         fSelectFeatures fSel = new fSelectFeatures(AtMng, CurrentRow());
         DialogResult    dr   = fSel.ShowDialog(this);
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             foreach (Janus.Windows.GridEX.GridEXRow gr in fSel.checkedRows)
             {
                 SecurityDB.secFeatureRow    fr = (SecurityDB.secFeatureRow)gr.DataRow;
                 SecurityDB.secPermissionRow pr = (SecurityDB.secPermissionRow)mySecMan.GetsecPermission().Add(CurrentRow());
                 pr.FeatureId = fr.FeatureId;
             }
         }
         secRuleGridEX.Refresh();
     }
     catch (Exception x)
     {
         throw x;
     }
 }