Example #1
0
        internal void CreateGroup(officeDB.OfficeRow or, FileManager offFM)
        {
            SecurityDB.secGroupRow gr = (SecurityDB.secGroupRow)offFM.AtMng.SecurityManager.GetsecGroup().Add(null);
            gr.GroupName = or.OfficeName;
            gr.DescE     = or.OfficeName;
            gr.DescF     = or.OfficeNameFre;

            BusinessProcess bp = myA.GetBP();

            bp.AddForUpdate(offFM.AtMng.SecurityManager.GetsecGroup());
            bp.Update();


            offFM.EFile.BreakInherit();
            atriumDB.secFileRuleRow sfr = (atriumDB.secFileRuleRow)offFM.GetsecFileRule().Add(offFM.CurrentFile);
            sfr.FileId  = offFM.CurrentFile.FileId;
            sfr.GroupId = gr.GroupId;
            sfr.RuleId  = (int)atSecurity.SpecialRules.GeneralRule;

            BusinessProcess bp1 = myA.GetBP();

            bp1.AddForUpdate(offFM.GetsecFileRule());
            bp1.Update();

            //get rid of new row if present as database new row will have been returned with a different pkid
            lmDatasets.atriumDB.secFileRuleRow sfr0 = offFM.DB.secFileRule.FindById(0);
            if (sfr0 != null)
            {
                offFM.DB.secFileRule.RemovesecFileRuleRow(sfr0);
                offFM.DB.secFileRule.AcceptChanges();
            }
        }
Example #2
0
        public override void ApplySecurity(DataRow dr)
        {
            if (FileForm() != null && FileForm().ReadOnly)
            {
                return;
            }

            lmDatasets.atriumDB.secFileRuleRow cbr = (lmDatasets.atriumDB.secFileRuleRow)dr;
            //UIHelper.EnableControls(secFileRuleBindingSource, FM.AtMng.SecurityManager.GetsecFileRule().CanEdit(cbr));
            if (FM.GetsecFileRule().CanEdit(cbr))
            {
                secFileRuleGridEX.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.True;
            }
            else
            {
                secFileRuleGridEX.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
            }

            UIHelper.EnableCommandBarCommand(tsDelete, FM.GetsecFileRule().CanDelete(cbr));
            UIHelper.EnableCommandBarCommand(tsAdd, FM.GetsecFileRule().CanAdd(cbr));
            UIHelper.EnableCommandBarCommand(tsBreakInherit, FM.GetsecFileRule().CanAdd(cbr));
        }
Example #3
0
        private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            try
            {
                switch (e.Command.Key)
                {
                case "cmdUnbreak":
                    FM.EFile.UnBreakInherit();
                    if (FM.EFile.GetParentFileXref(FM.CurrentFile).secBreakInherit)
                    {
                        cmdUnbreak.Enabled     = Janus.Windows.UI.InheritableBoolean.True;
                        tsBreakInherit.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                    }
                    else
                    {
                        cmdUnbreak.Enabled     = Janus.Windows.UI.InheritableBoolean.False;
                        tsBreakInherit.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                    }
                    break;

                case "tsBreakInherit":
                    FM.EFile.BreakInherit();
                    if (FM.EFile.GetParentFileXref(FM.CurrentFile).secBreakInherit)
                    {
                        cmdUnbreak.Enabled     = Janus.Windows.UI.InheritableBoolean.True;
                        tsBreakInherit.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                    }
                    else
                    {
                        cmdUnbreak.Enabled     = Janus.Windows.UI.InheritableBoolean.False;
                        tsBreakInherit.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                    }
                    break;

                case "tsAdd":
                    lmDatasets.atriumDB.secFileRuleRow dr = (lmDatasets.atriumDB.secFileRuleRow)FM.GetsecFileRule().Add(FM.CurrentFile);
                    dr.FileId = FM.CurrentFile.FileId;
                    secFileRuleBindingSource.MoveLast();
                    break;

                case "tsSave":
                    Save();
                    break;

                case "tsCancel":
                    Cancel();
                    break;

                case "tsDelete":
                    Delete();
                    break;


                case "tsAudit":
                    fData fAudit = new fData(CurrentRow());
                    fAudit.Show();
                    break;
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }