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(); }
/// <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); } }
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(); }
/// <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); }
/// <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); }
/// <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); } }
/// <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); }
/// <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); }
/// <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(); }
/// <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); }
/// <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); } }
/// <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); }
/// <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); }
/// <summary> /// Создать предопределенные роли. /// </summary> public static void CreateRoles() { InitializationLogger.Debug("Init: Create Default Roles"); Docflow.PublicInitializationFunctions.Module.CreateRole(Resources.ExchangeServiceUsersRoleName, Resources.ExchangeServiceUsersRoleDescription, Constants.Module.RoleGuid.ExchangeServiceUsersRoleGuid); }
/// <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(); }
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); } }
/// <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(); }
/// <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); }
/// <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); }
public override void Initializing(Sungero.Domain.ModuleInitializingEventArgs e) { CreateReportsTables(); GrantRightsToResponsibilitiesReport(); CreateSorageProcedures(); InitializationLogger.Debug("Init: Create visibility settings."); CreateVisibilitySettings(); CreateIndecies(); }
/// <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); }
/// <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(); }
/// <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(); }
/// <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: Удалены права доступа на Создание для документа Входящий счет"); } }
/// <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(); }
/// <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); }
/// <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("Выданы права на вычисляемую папку 'Внутренние документы'"); }
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(); }
/// <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(); }
/// <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(); }