/// <summary>
        /// Override this method to perform custom initialization of the action model,
        /// such as adding permissions or adding custom actions.
        /// </summary>
        /// <param name="model"></param>
        protected override void InitializeActionModel(AdminActionModel model)
        {
            base.InitializeActionModel(model);

            _resetPasswordAction = model.AddAction("resetPassword", SR.TitleResetPassword, "Icons.ResetToolSmall.png",
                                                   SR.TitleResetPassword, ResetUserPassword, ClearCanvas.Enterprise.Common.AuthorityTokens.Admin.Security.User);

            _viewSessionsAction = model.AddAction("viewSessions", "View Sessions", "Icons.ViewUserSessionsSmall.png",
                                                  SR.TitleViewUserSessions, ViewUserSessions, ClearCanvas.Enterprise.Common.AuthorityTokens.Admin.Security.User);

            model.Add.SetPermissibility(ClearCanvas.Enterprise.Common.AuthorityTokens.Admin.Security.User);
            model.Edit.SetPermissibility(ClearCanvas.Enterprise.Common.AuthorityTokens.Admin.Security.User);
            model.Delete.SetPermissibility(ClearCanvas.Enterprise.Common.AuthorityTokens.Admin.Security.User);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Override this method to perform custom initialization of the action model,
        /// such as adding permissions or adding custom actions.
        /// </summary>
        /// <param name="model"></param>
        protected override void InitializeActionModel(AdminActionModel model)
        {
            base.InitializeActionModel(model);

            _duplicateCannedTextAction = model.AddAction("duplicateCannedText", SR.TitleDuplicate, "Icons.DuplicateSmall.png",
                                                         SR.TitleDuplicate, DuplicateAdd);

            _copyCannedTextToClipboardAction = model.AddAction("copyCannedText", SR.TitleCopy, "Icons.CopyToClipboardToolSmall.png",
                                                               SR.MessageCopyToClipboard, CopyCannedText);

            _editCannedTextCategoryAction = model.AddAction("editCategory", SR.TitleChangeCategory, "Icons.MultiEditToolSmall.png",
                                                            SR.MessageChangeCategoryToolTip, EditCategories);

            _duplicateCannedTextAction.Enabled       = false;
            _copyCannedTextToClipboardAction.Enabled = false;
            _editCannedTextCategoryAction.Enabled    = false;
        }
            private void ProcessItems <T>(IEnumerable <T> items, Action <T> processAction, bool cancelable)
            {
                var itemsToProcess = items.ToList();

                // if just one item, process it synchronously
                if (itemsToProcess.Count == 1)
                {
                    processAction(itemsToProcess[0]);
                    return;
                }

                // otherwise do progress dialog
                ProgressDialog.Show(_owner.Host.DesktopWindow,
                                    itemsToProcess,
                                    (item, i) =>
                {
                    processAction(item);
                    return(string.Format(SR.MessageProcessedItemsProgress, i + 1, itemsToProcess.Count));
                },
                                    cancelable);
            }
Exemplo n.º 4
0
        /// <summary>
        /// Override this method to perform custom initialization of the action model,
        /// such as adding permissions or adding custom actions.
        /// </summary>
        /// <param name="model"></param>
        protected override void InitializeActionModel(AdminActionModel model)
        {
            base.InitializeActionModel(model);

            model.Add.SetPermissibility(
                OrPermissions(
                    Application.Common.AuthorityTokens.Admin.Data.ExternalPractitioner,
                    Application.Common.AuthorityTokens.Workflow.ExternalPractitioner.Create));
            model.Edit.SetPermissibility(
                OrPermissions(
                    Application.Common.AuthorityTokens.Admin.Data.ExternalPractitioner,
                    Application.Common.AuthorityTokens.Workflow.ExternalPractitioner.Update));

            // these actions are only available to admins
            model.Delete.SetPermissibility(Application.Common.AuthorityTokens.Admin.Data.ExternalPractitioner);
            model.ToggleActivation.SetPermissibility(Application.Common.AuthorityTokens.Admin.Data.ExternalPractitioner);

            _mergePractitionerAction = model.AddAction("mergePractitioner", SR.TitleMergePractitioner, "Icons.MergePersonToolMedium.png",
                                                       SR.TitleMergePractitioner, MergePractitioners);
            _mergePractitionerAction.Enabled = false;
            _mergePractitionerAction.SetPermissibility(
                OrPermissions(
                    Application.Common.AuthorityTokens.Admin.Data.ExternalPractitioner,
                    Application.Common.AuthorityTokens.Workflow.ExternalPractitioner.Merge));

            _mergeContactPointAction = model.AddAction("mergeContactPoint", SR.TitleMergeContactPoints, "Icons.MergeContactPointToolMedium.png",
                                                       SR.TitleMergeContactPoints, MergeContactPoint);
            _mergeContactPointAction.Enabled = false;
            _mergeContactPointAction.SetPermissibility(
                OrPermissions(
                    Application.Common.AuthorityTokens.Admin.Data.ExternalPractitioner,
                    Application.Common.AuthorityTokens.Workflow.ExternalPractitioner.Merge));

            // #10231: hide these tools for the time being, since the functionality is not well tested
            _mergePractitionerAction.Visible = false;
            _mergeContactPointAction.Visible = false;
        }