示例#1
0
        //Security Per Process. I.e. on a global level thus being applied to each new Process Instance being started.
        public void ActionRights()
        {
            //Route to get to Action Rights. If Event ID not known.
            Activities activities = ManagementServer.GetProcInstActivities(1); //Process Instance ID

            foreach (Activity activity in activities)
            {
                Events events = ManagementServer.GetActivityEvents(activity.ID);

                foreach (Event ev in events)
                {
                    ActionRights actionRightsToSave = new ActionRights();

                    //Get all Action Rights
                    ActionRights eventActionRights = ManagementServer.GetActionRights(ev.ID);
                    foreach (ActionRight actionRight in eventActionRights)
                    {
                        actionRight.Denied  = false;
                        actionRight.Execute = true;

                        actionRightsToSave.Add(actionRight);
                    }

                    //Save Action Rights
                    ManagementServer.SaveActionRights(actionRightsToSave);
                }
            }
        }