コード例 #1
0
        public static void GrantRightsOnDatabooks(IRole allUsers)
        {
            InitializationLogger.Debug("Init: Grant rights on databooks to all users.");

            ProjectKinds.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
            ProjectKinds.AccessRights.Save();
        }
コード例 #2
0
        /// <summary>
        /// Выдать права на спец.папки модуля.
        /// </summary>
        /// <param name="allUsers">Группа "Все пользователи".</param>
        public static void GrantRightOnFolders(IRole allUsers)
        {
            InitializationLogger.Debug("Init: Grant right on contracts special folders to all users.");
            var hasLicense = Docflow.PublicFunctions.Module.Remote.IsModuleAvailableByLicense(Sungero.Contracts.Constants.Module.ContractsUIGuid);
            Dictionary <int, byte[]> licenses = null;

            try
            {
                if (!hasLicense)
                {
                    licenses = Docflow.PublicFunctions.Module.ReadLicense();
                    Docflow.PublicFunctions.Module.DeleteLicense();
                }

                Sungero.ContractsUI.SpecialFolders.ContractsList.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
                Sungero.ContractsUI.SpecialFolders.ExpiringSoonContracts.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
                Sungero.ContractsUI.SpecialFolders.ContractsAtContractors.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
                Sungero.ContractsUI.SpecialFolders.IssuanceJournal.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
                Sungero.ContractsUI.SpecialFolders.ContractsHistory.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);

                Sungero.ContractsUI.SpecialFolders.ContractsList.AccessRights.Save();
                Sungero.ContractsUI.SpecialFolders.ExpiringSoonContracts.AccessRights.Save();
                Sungero.ContractsUI.SpecialFolders.ContractsAtContractors.AccessRights.Save();
                Sungero.ContractsUI.SpecialFolders.IssuanceJournal.AccessRights.Save();
                Sungero.ContractsUI.SpecialFolders.ContractsHistory.AccessRights.Save();
            }
            finally
            {
                Docflow.PublicFunctions.Module.RestoreLicense(licenses);
            }
        }
コード例 #3
0
        public override void Initializing(Sungero.Domain.ModuleInitializingEventArgs e)
        {
            var allUsers = Roles.AllUsers;

            if (allUsers != null)
            {
                // Документы.
                InitializationLogger.Debug("Init: Grant rights on documents to all users.");
                GrantRightsOnDocuments(allUsers);

                // Справочники.
                InitializationLogger.Debug("Init: Grant rights on databooks to all users.");
                GrantRightsOnDatabooks(allUsers);
            }

            // Назначить права роли "Руководители проектов".
            InitializationLogger.Debug("Init: Grant rights on projects");
            GrantRightsOnProjects();

            CreateDocumentTypes();
            CreateDocumentKinds();
            CreateProjectKinds();
            CreateProjectFolder();
            GrantReadRightsOnProjectDocuments();
            GrantReadRightsOnProjectTeam();

            CreateDefaultApprovalRoles();
            CreateDefaultApprovalRules();
        }
コード例 #4
0
        /// <summary>
        /// Создать предопределенные роли.
        /// </summary>
        public static void CreateRoles()
        {
            InitializationLogger.Debug("Init: Create Default Roles");

            Docflow.PublicInitializationFunctions.Module.CreateRole(Docflow.Resources.RoleNameContractsResponsible, Sungero.Contracts.Resources.DescriptionResponsibleForContractsRole, Docflow.Constants.Module.RoleGuid.ContractsResponsible);
            Docflow.PublicInitializationFunctions.Module.CreateRole(Docflow.Resources.RoleNameRegistrationContracts, Sungero.Contracts.Resources.DescriptionContractsRegistrarRole, Docflow.Constants.Module.RoleGuid.RegistrationContractualDocument);
        }
コード例 #5
0
        /// <summary>
        /// Создать базовые роли согласования.
        /// </summary>
        public static void CreateDefaultApprovalRoles()
        {
            InitializationLogger.Debug("Init: Create default approval roles.");

            CreateApprovalRole(Docflow.ApprovalRoleBase.Type.ProjectManager, Sungero.Projects.Resources.RoleDescriptionProjectManager);
            CreateApprovalRole(Docflow.ApprovalRoleBase.Type.ProjectAdmin, Sungero.Projects.Resources.RoleDescriptionProjectAdministrator);
        }
コード例 #6
0
        /// <summary>
        /// Создать правила согласования по умолчанию для финансовых документов.
        /// </summary>
        public static void CreateDefaultFinancialApprovalRules()
        {
            InitializationLogger.Debug("Init: Create default financial approval rules.");

            var stages = new List <Enumeration>
            {
                StageType.Manager, StageType.Approvers, StageType.Print, StageType.Sign, StageType.Sending, StageType.CheckReturn, StageType.Notice
            };

            var rule = CreateDefaultRule(Resources.DefaultApprovalRuleNameFinancial,
                                         Docflow.ApprovalRuleBase.DocumentFlow.Contracts,
                                         stages);

            // Добавить условие по способу отправки и непосредственный руководитель - подписывающий, для созданного правила.
            if (rule != null)
            {
                var condition = Contracts.ContractConditions.Create();
                condition.ConditionType = Docflow.ConditionBase.ConditionType.DeliveryMethod;
                var newDeliveryMethod = condition.DeliveryMethods.AddNew();
                newDeliveryMethod.DeliveryMethod = Docflow.MailDeliveryMethods.GetAll(m => m.Sid == Docflow.Constants.MailDeliveryMethod.Exchange).FirstOrDefault();
                condition.Save();
                var printStageNumber = stages.IndexOf(StageType.Print) + 1;
                Docflow.PublicInitializationFunctions.Module.AddConditionToRule(rule, condition, printStageNumber);

                var rolesCompareCondition = Docflow.PublicInitializationFunctions.Module.CreateRoleCompareSignatoryAndInitManagerCondition(Contracts.ContractConditions.Create());
                var managerStageNumber    = stages.IndexOf(StageType.Manager) + 1;
                Docflow.PublicInitializationFunctions.Module.AddConditionToRule(rule, rolesCompareCondition, managerStageNumber);
            }
        }
コード例 #7
0
        /// <summary>
        /// Создать виды документов для делопроизводства.
        /// </summary>
        public static void CreateDocumentKinds()
        {
            InitializationLogger.Debug("Init: Create document kinds.");

            var notifiable = Docflow.DocumentKind.NumberingType.Registrable;

            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(RecordManagement.Resources.IncomingLetterKindName, RecordManagement.Resources.IncomingLetterKindShortName, notifiable, Docflow.DocumentRegister.DocumentFlow.Incoming,
                                                                            true, false, IncomingLetter.ClassTypeGuid, null,
                                                                            Init.IncomingLetterKind);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(RecordManagement.Resources.OutgoingLetterKindName, RecordManagement.Resources.OutgoingLetterKindShortName, notifiable, Docflow.DocumentRegister.DocumentFlow.Outgoing,
                                                                            true, false, OutgoingLetter.ClassTypeGuid, null, Init.OutgoingLetterKind);

            var actions = new Domain.Shared.IActionInfo[] { OfficialDocuments.Info.Actions.SendActionItem,
                                                            OfficialDocuments.Info.Actions.SendForApproval,
                                                            OfficialDocuments.Info.Actions.SendForFreeApproval,
                                                            OfficialDocuments.Info.Actions.SendForAcquaintance };

            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(RecordManagement.Resources.OrderKindName, RecordManagement.Resources.OrderKindShortName, notifiable, DocumentFlow.Inner,
                                                                            true, false, Order.ClassTypeGuid,
                                                                            actions,
                                                                            Init.OrderKind);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(RecordManagement.Resources.CompanyDirectiveKindName, RecordManagement.Resources.CompanyDirectiveKindShortName, notifiable, DocumentFlow.Inner,
                                                                            true, false, CompanyDirective.ClassTypeGuid,
                                                                            actions,
                                                                            Init.CompanyDirective);
        }
コード例 #8
0
        /// <summary>
        /// Создать предопределенные сайты проверки контрагента.
        /// </summary>
        public static void CreateDefaultDueDiligenceWebsites()
        {
            InitializationLogger.Debug("Init: Create Default Due Diligence Websites");

            CreateDueDiligenceWebsite(Parties.Constants.DueDiligenceWebsite.Initialize.OwnerOnlineWebsite,
                                      Parties.DueDiligenceWebsites.Resources.OwnerOnlineWebsiteName,
                                      Constants.DueDiligenceWebsite.Websites.OwnerOnline.HomePage,
                                      Constants.DueDiligenceWebsite.Websites.OwnerOnline.DueDiligencePage, false,
                                      Parties.DueDiligenceWebsites.Resources.OwnerOnlineNote,
                                      Constants.DueDiligenceWebsite.Websites.OwnerOnline.DueDiligencePage);
            CreateDueDiligenceWebsite(Parties.Constants.DueDiligenceWebsite.Initialize.ForFairBusinessWebsite,
                                      Parties.DueDiligenceWebsites.Resources.ForFairBusinessWebsiteName,
                                      Constants.DueDiligenceWebsite.Websites.ForFairBusiness.HomePage,
                                      Constants.DueDiligenceWebsite.Websites.ForFairBusiness.DueDiligencePage, false,
                                      Parties.DueDiligenceWebsites.Resources.ForFairBusinessNote,
                                      Constants.DueDiligenceWebsite.Websites.ForFairBusiness.DueDiligencePageSE);
            CreateDueDiligenceWebsite(Parties.Constants.DueDiligenceWebsite.Initialize.HonestBusinessWebsite,
                                      Parties.DueDiligenceWebsites.Resources.HonestBusinessWebsiteName,
                                      Constants.DueDiligenceWebsite.Websites.HonestBusiness.HomePage,
                                      Constants.DueDiligenceWebsite.Websites.HonestBusiness.DueDiligencePage, true,
                                      Parties.DueDiligenceWebsites.Resources.HonestBusinessNote);
            CreateDueDiligenceWebsite(Parties.Constants.DueDiligenceWebsite.Initialize.KonturFocusWebsite,
                                      Parties.DueDiligenceWebsites.Resources.KonturFocusWebsiteName,
                                      Constants.DueDiligenceWebsite.Websites.KonturFocus.HomePage,
                                      Constants.DueDiligenceWebsite.Websites.KonturFocus.DueDiligencePage, false,
                                      Parties.DueDiligenceWebsites.Resources.KonturFocusNote);
            CreateDueDiligenceWebsite(Parties.Constants.DueDiligenceWebsite.Initialize.SbisWebsite,
                                      Parties.DueDiligenceWebsites.Resources.SbisWebsiteName,
                                      Constants.DueDiligenceWebsite.Websites.Sbis.HomePage,
                                      Constants.DueDiligenceWebsite.Websites.Sbis.DueDiligencePage, false,
                                      Parties.DueDiligenceWebsites.Resources.SbisNote);
        }
コード例 #9
0
        /// <summary>
        /// Выдать права всем пользователям на документы.
        /// </summary>
        /// <param name="allUsers">Группа "Все пользователи".</param>
        public static void GrantRightsOnDocuments(IRole allUsers)
        {
            InitializationLogger.Debug("Init: Grant rights on documents to all users.");

            IncomingInvoices.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Create);
            IncomingInvoices.AccessRights.Save();
        }
コード例 #10
0
        /// <summary>
        /// Создать базовые роли согласования.
        /// </summary>
        public static void CreateDefaultApprovalRoles()
        {
            InitializationLogger.Debug("Init: Create default approval roles.");

            CreateApprovalRole(Docflow.ApprovalRoleBase.Type.ContractResp, Sungero.Contracts.Resources.RoleDescriptionContractResponsible);
            CreateApprovalRole(Docflow.ApprovalRoleBase.Type.ContRespManager, Sungero.Contracts.Resources.RoleDescriptionContractResponsibleManager);
        }
コード例 #11
0
        /// <summary>
        /// Выдать права всем пользователям на спец.папки.
        /// </summary>
        /// <param name="allUsers">Роль "Все пользователи".</param>
        public static void GrantRightOnFolders(IRole allUsers)
        {
            InitializationLogger.Debug("Init: Grant right on special folders to all users.");

            RecordManagement.SpecialFolders.ForExecution.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
            RecordManagement.SpecialFolders.ActionItems.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
            RecordManagement.SpecialFolders.ForExecution.AccessRights.Save();
            RecordManagement.SpecialFolders.ActionItems.AccessRights.Save();

            var hasLicense = Docflow.PublicFunctions.Module.Remote.IsModuleAvailableByLicense(Guid.Parse("51247c94-981f-4bc8-819a-128704b5aa31"));
            Dictionary <int, byte[]> licenses = null;

            try
            {
                if (!hasLicense)
                {
                    licenses = Docflow.PublicFunctions.Module.ReadLicense();
                    Docflow.PublicFunctions.Module.DeleteLicense();
                }

                RecordManagementUI.SpecialFolders.DocumentsToReturn.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
                RecordManagementUI.SpecialFolders.DocumentsToReturn.AccessRights.Save();
            }
            finally
            {
                Docflow.PublicFunctions.Module.RestoreLicense(licenses);
            }
        }
コード例 #12
0
        /// <summary>
        /// Создать виды проектных документов.
        /// </summary>
        public static void CreateDocumentKinds()
        {
            InitializationLogger.Debug("Init: Create document kinds.");

            var notifiable   = Docflow.DocumentKind.NumberingType.Registrable;
            var numerable    = Docflow.DocumentKind.NumberingType.Numerable;
            var notNumerable = Docflow.DocumentKind.NumberingType.NotNumerable;

            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(Sungero.Projects.Resources.CustomerRequirementsKindName,
                                                                            Sungero.Projects.Resources.CustomerRequirementsKindShortName, notNumerable,
                                                                            Docflow.DocumentKind.DocumentFlow.Inner, true, false, ProjectDocument.ClassTypeGuid, null, true, true,
                                                                            Init.CustomerRequirementsKind, false);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(Sungero.Projects.Resources.RegulationsKindName,
                                                                            Sungero.Projects.Resources.RegulationsKindShortName, notNumerable,
                                                                            Docflow.DocumentKind.DocumentFlow.Inner, true, false, ProjectDocument.ClassTypeGuid, null, true, true,
                                                                            Init.RegulationsKind, false);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(Sungero.Projects.Resources.ReportKindName, Sungero.Projects.Resources.ReportKindShortName, notNumerable,
                                                                            Docflow.DocumentKind.DocumentFlow.Inner, true, false, ProjectDocument.ClassTypeGuid, null, true, true,
                                                                            Init.ReportKind, false);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(Sungero.Projects.Resources.ScheduleKindName, Sungero.Projects.Resources.ScheduleKindShortName, notNumerable,
                                                                            Docflow.DocumentKind.DocumentFlow.Inner, true, false, ProjectDocument.ClassTypeGuid, null, true, true,
                                                                            Init.ScheduleKind, false);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(Sungero.Projects.Resources.ProjectSolutionKindName, Sungero.Projects.Resources.ProjectSolutionKindShortName, notNumerable,
                                                                            Docflow.DocumentKind.DocumentFlow.Inner, true, false, ProjectDocument.ClassTypeGuid, null, true, true,
                                                                            Init.ProjectSolutionKind, false);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentKind(Sungero.Projects.Resources.AnalyticNoteKindName, Sungero.Projects.Resources.AnalyticNoteKindShortName, notNumerable,
                                                                            Docflow.DocumentKind.DocumentFlow.Inner, true, false, ProjectDocument.ClassTypeGuid, null, true, true,
                                                                            Init.AnalyticNoteKind, false);
        }
コード例 #13
0
        /// <summary>
        /// Создать типы документов для договоров.
        /// </summary>
        public static void CreateDocumentTypes()
        {
            InitializationLogger.Debug("Init: Create document types");

            Docflow.PublicInitializationFunctions.Module.CreateDocumentType(Sungero.Contracts.Resources.ContractTypeName, Contract.ClassTypeGuid, Docflow.DocumentType.DocumentFlow.Contracts, true);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentType(Sungero.Contracts.Resources.SupAgreementTypeName, SupAgreement.ClassTypeGuid, Docflow.DocumentType.DocumentFlow.Contracts, true);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentType(Sungero.Contracts.Resources.IncomingInvoiceTypeName, IncomingInvoice.ClassTypeGuid, Docflow.DocumentType.DocumentFlow.Incoming, false);
        }
コード例 #14
0
        /// <summary>
        /// Создать предопределенные роли.
        /// </summary>
        public static void CreateRoles()
        {
            InitializationLogger.Debug("Init: Create Default Roles");

            Docflow.PublicInitializationFunctions.Module.CreateRole(Resources.ExchangeServiceUsersRoleName,
                                                                    Resources.ExchangeServiceUsersRoleDescription,
                                                                    Constants.Module.RoleGuid.ExchangeServiceUsersRoleGuid);
        }
コード例 #15
0
        /// <summary>
        /// Выдать права всем пользователям на справочники.
        /// </summary>
        /// <param name="allUsers">Группа "Все пользователи".</param>
        public static void GrantRightsOnDatabooks(IRole allUsers)
        {
            InitializationLogger.Debug("Init: Grant rights on databooks to all users.");

            RecordManagement.AcquaintanceLists.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Create);
            RecordManagement.AcquaintanceTaskParticipants.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.FullAccess);
            RecordManagement.AcquaintanceLists.AccessRights.Save();
            RecordManagement.AcquaintanceTaskParticipants.AccessRights.Save();
        }
コード例 #16
0
        public static void AddAcquaintanceTaskPerformersLimit()
        {
            InitializationLogger.Debug("Init: Adding performers limit of acquaintance task .");

            if (Docflow.PublicFunctions.Module.GetDocflowParamsValue(Constants.AcquaintanceTask.PerformersLimitParamName) == null)
            {
                Docflow.PublicFunctions.Module.InsertOrUpdateDocflowParam(Constants.AcquaintanceTask.PerformersLimitParamName, Constants.AcquaintanceTask.DefaultPerformersLimit);
            }
        }
コード例 #17
0
        /// <summary>
        /// Выдать права на Проектные команды.
        /// </summary>
        public static void GrantReadRightsOnProjectTeam()
        {
            InitializationLogger.Debug("Init: Grant rights on ProjectTeam to all users.");

            var role = Roles.AllUsers;

            Sungero.Projects.ProjectTeams.AccessRights.Grant(role, DefaultAccessRightsTypes.Read);
            Sungero.Projects.ProjectTeams.AccessRights.Save();
        }
コード例 #18
0
        /// <summary>
        /// Создать типы документов для делопроизводства.
        /// </summary>
        public static void CreateDocumentTypes()
        {
            InitializationLogger.Debug("Init: Create document types");

            Docflow.PublicInitializationFunctions.Module.CreateDocumentType(RecordManagement.Resources.IncomingLetterTypeName, IncomingLetter.ClassTypeGuid, Docflow.DocumentType.DocumentFlow.Incoming, true);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentType(RecordManagement.Resources.OutgoingLetterTypeName, OutgoingLetter.ClassTypeGuid, Docflow.DocumentType.DocumentFlow.Outgoing, true);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentType(RecordManagement.Resources.OrderTypeName, Order.ClassTypeGuid, Docflow.DocumentType.DocumentFlow.Inner, true);
            Docflow.PublicInitializationFunctions.Module.CreateDocumentType(RecordManagement.Resources.CompanyDirectiveTypeName, CompanyDirective.ClassTypeGuid, Docflow.DocumentType.DocumentFlow.Inner, true);
        }
コード例 #19
0
        /// <summary>
        /// Создать журналы и настройки регистрации.
        /// </summary>
        public static void CreateDocumentRegistersAndSettings()
        {
            InitializationLogger.Debug("Init: Create default document registers and settings for docflow.");

            var minutesRegister = Docflow.PublicInitializationFunctions.Module.CreateYearSectionDocumentRegister(Resources.RegistersAndSettingsMinutesName,
                                                                                                                 Resources.RegistersAndSettingsMinutesIndex,
                                                                                                                 Constants.Module.MinutesRegister);

            Docflow.PublicInitializationFunctions.Module.CreateNumerationSetting(Minutes.ClassTypeGuid, Docflow.RegistrationSetting.DocumentFlow.Inner, minutesRegister);
        }
コード例 #20
0
        public override void Initializing(Sungero.Domain.ModuleInitializingEventArgs e)
        {
            CreateReportsTables();
            GrantRightsToResponsibilitiesReport();
            CreateSorageProcedures();

            InitializationLogger.Debug("Init: Create visibility settings.");
            CreateVisibilitySettings();
            CreateIndecies();
        }
コード例 #21
0
        /// <summary>
        /// Создать базовые правила согласования.
        /// </summary>
        public static void CreateDefaultApprovalRules()
        {
            InitializationLogger.Debug("Init: Create default approval rules.");

            var stages = new List <Enumeration> {
                Docflow.ApprovalStage.StageType.Approvers, Docflow.ApprovalStage.StageType.Approvers, Docflow.ApprovalStage.StageType.Sign, Docflow.ApprovalStage.StageType.Notice
            };

            CreateApprovalRule(Resources.DefaultApprovalRuleNameProjectDocument, stages);
        }
コード例 #22
0
        /// <summary>
        /// Выдать права всем пользователям на документы.
        /// </summary>
        /// <param name="allUsers">Группа "Все пользователи".</param>
        public static void GrantRightsOnDocuments(IRole allUsers)
        {
            InitializationLogger.Debug("Init: Grant rights on documents to all users.");

            RecordManagement.OrderBases.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Create);
            RecordManagement.OutgoingLetters.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Create);
            RecordManagement.IncomingLetters.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Create);
            RecordManagement.OrderBases.AccessRights.Save();
            RecordManagement.OutgoingLetters.AccessRights.Save();
            RecordManagement.IncomingLetters.AccessRights.Save();
        }
コード例 #23
0
        /// <summary>
        /// Выдать права всем пользователям на справочники.
        /// </summary>
        public static void GrantRightsOnDatabooks()
        {
            InitializationLogger.Debug("Init: Grant rights on databooks to all users.");
            var allUsers = Roles.AllUsers;

            BoxBases.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
            ExchangeServices.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);

            BoxBases.AccessRights.Save();
            ExchangeServices.AccessRights.Save();
        }
コード例 #24
0
        /// <summary>
        /// Удаление прав доступа.
        /// </summary>
        public static void RevokeRightsToObjects()
        {
            var allUsers = Roles.AllUsers;

            if (allUsers != null)
            {
                Sungero.Contracts.IncomingInvoices.AccessRights.Revoke(allUsers, DefaultAccessRightsTypes.Create);
                Sungero.Contracts.IncomingInvoices.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Forbidden);
                Sungero.Contracts.IncomingInvoices.AccessRights.Save();
                InitializationLogger.Debug("fx_Init: Удалены права доступа на Создание для документа Входящий счет");
            }
        }
コード例 #25
0
        /// <summary>
        /// Функция инициализации для выдачи прав на "Проектные документы".
        /// </summary>
        public static void GrantRights()
        {
            InitializationLogger.Debug("Init: Issuance of rights to all");
            var role = Roles.GetAll().FirstOrDefault(r => r.Sid == Constants.Module.Initialize.FinanceArchiveGuid);

            if (role == null)
            {
                return;
            }
            finex.Entity.DocumentProjects.AccessRights.Grant(role, DefaultAccessRightsTypes.Create);
            finex.Entity.DocumentProjects.AccessRights.Save();
        }
コード例 #26
0
        /// <summary>
        /// Создать журнал и настройки регистрации для актов и доп. соглашений.
        /// </summary>
        public static void CreateDocumentRegisterAndSettingsForContracts()
        {
            InitializationLogger.Debug("Init: Create default logs and settings for contracts.");

            var supAgreementDocumentRegister = CreateLeadNumberedDocumentRegister(Resources.RegistersAndSettingsSupAgreementName,
                                                                                  Resources.RegistersAndSettingsSupAgreementIndex,
                                                                                  Init.SupAgreementRegister);

            Docflow.PublicInitializationFunctions.Module.CreateNumerationSetting(SupAgreement.ClassTypeGuid,
                                                                                 Docflow.RegistrationSetting.DocumentFlow.Contracts,
                                                                                 supAgreementDocumentRegister);
        }
コード例 #27
0
        /// <summary>
        /// Функция инициализации для выдачи прав на вычисляемые папки.
        /// </summary>
        public static void GrantRightsOnFolder()
        {
            var allUsers = Roles.AllUsers;

            finex.Subject.Module.RecordManagementUI.SpecialFolders.IncomingDocumentsfinex.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
            finex.Subject.Module.RecordManagementUI.SpecialFolders.IncomingDocumentsfinex.AccessRights.Save();
            InitializationLogger.Debug("Выданы права на вычисляемую папку 'Входящие документы'");
            finex.Subject.Module.RecordManagementUI.SpecialFolders.OutgoingDocumentsfinex.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
            finex.Subject.Module.RecordManagementUI.SpecialFolders.OutgoingDocumentsfinex.AccessRights.Save();
            InitializationLogger.Debug("Выданы права на вычисляемую папку 'Исходящие документы'");
            finex.Subject.Module.RecordManagementUI.SpecialFolders.InternalDocumentsfinex.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
            finex.Subject.Module.RecordManagementUI.SpecialFolders.InternalDocumentsfinex.AccessRights.Save();
            InitializationLogger.Debug("Выданы права на вычисляемую папку 'Внутренние документы'");
        }
コード例 #28
0
        public override void Initializing(Sungero.Domain.ModuleInitializingEventArgs e)
        {
            // Создание ролей.
            InitializationLogger.Debug("Init: Create roles.");
            CreateRoles();

            // Выдача прав роли "Ответственные за совещания".
            InitializationLogger.Debug("Init: Grant right on financial documents for responsible.");
            GrantRightToMeetingResponsible();

            CreateDocumentTypes();
            CreateDocumentKinds();
            CreateDocumentRegistersAndSettings();
        }
コード例 #29
0
        /// <summary>
        /// Инициализация роли "Пользователи с правами на работу через сервис обмена".
        /// </summary>
        public static void InitializeExchangeServiceUsersRole()
        {
            InitializationLogger.Debug("Init: Initialize Exchange Service Users role");

            var exchangeServiceUsersRole = ExchangeCore.PublicFunctions.Module.GetExchangeServiceUsersRole();

            if (exchangeServiceUsersRole == null)
            {
                InitializationLogger.Debug("Init: No service users role found");
                return;
            }

            Parties.Counterparties.AccessRights.Grant(exchangeServiceUsersRole, Constants.Module.DefaultAccessRightsTypeSid.SetExchange);
            Parties.Counterparties.AccessRights.Save();
        }
コード例 #30
0
        /// <summary>
        /// Выдать права роли "Ответственные за настройку регистрации".
        /// </summary>
        public static void GrantRightToRegistrationManagersRole()
        {
            InitializationLogger.Debug("Init: Grant rights on logs and registration settings to registration managers.");

            var registrationManagers  = Roles.GetAll().SingleOrDefault(n => n.Sid == Docflow.Constants.Module.RoleGuid.RegistrationManagersRole);
            var registrationContracts = Roles.GetAll().SingleOrDefault(n => n.Sid == Docflow.Constants.Module.RoleGuid.RegistrationContractualDocument);

            if (registrationManagers == null || registrationContracts == null)
            {
                return;
            }

            registrationContracts.AccessRights.Grant(registrationManagers, DefaultAccessRightsTypes.Change);
            registrationContracts.Save();
        }