Пример #1
0
        // user ////////////////////////////////////////////////////////////////

        protected internal virtual User createUser(IdentityService identityService, string userId)
        {
            User user = identityService.newUser(userId);

            identityService.saveUser(user);
            return(user);
        }
Пример #2
0
            public void execute(ProcessEngine engine, string scenarioName)
            {
                // given
                IdentityService identityService = engine.IdentityService;
                User            user            = identityService.newUser(USER_NAME);

                user.Password = USER_PWD;

                // when
                identityService.saveUser(user);
            }
Пример #3
0
            public void execute(ProcessEngine processEngine, string s)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.IdentityService identityService = processEngine.getIdentityService();
                IdentityService identityService = processEngine.IdentityService;

                User user = identityService.newUser(USER_ID);

                user.Password = PASSWORD;
                identityService.saveUser(user);

                ((ProcessEngineConfigurationImpl)processEngine.ProcessEngineConfiguration).CommandExecutorTxRequired.execute(new CommandAnonymousInnerClass(this, identityService));
            }
Пример #4
0
            public void execute(ProcessEngine engine, string scenarioName)
            {
                IdentityService identityService = engine.IdentityService;

                string userId  = USER_ID + scenarioName;
                string groupid = GROUP_ID + scenarioName;
                // create an user
                User user = identityService.newUser(userId);

                identityService.saveUser(user);

                // create group
                Group group = identityService.newGroup(groupid);

                identityService.saveGroup(group);

                // create membership
                identityService.createMembership(userId, groupid);

                //create full authorization
                AuthorizationService authorizationService = engine.AuthorizationService;

                //authorization for process definition
                Authorization authProcDef = createAuthorization(authorizationService, Permissions.ALL, Resources.PROCESS_DEFINITION, userId);

                engine.AuthorizationService.saveAuthorization(authProcDef);

                //authorization for deployment
                Authorization authDeployment = createAuthorization(authorizationService, Permissions.ALL, Resources.DEPLOYMENT, userId);

                engine.AuthorizationService.saveAuthorization(authDeployment);

                //authorization for process instance create
                Authorization authProcessInstance = createAuthorization(authorizationService, Permissions.CREATE, Resources.PROCESS_INSTANCE, userId);

                engine.AuthorizationService.saveAuthorization(authProcessInstance);

                // start a process instance
                engine.RuntimeService.startProcessInstanceByKey(PROCESS_DEF_KEY, scenarioName);
            }
Пример #5
0
            public void execute(ProcessEngine engine, string scenarioName)
            {
                IdentityService identityService = engine.IdentityService;

                // create an user
                string userId = "test";
                User   user   = identityService.newUser(userId);

                identityService.saveUser(user);

                // create group
                string groupId = "accounting";
                Group  group   = identityService.newGroup(groupId);

                identityService.saveGroup(group);

                // create membership
                identityService.createMembership("test", "accounting");

                // start a process instance
                engine.RuntimeService.startProcessInstanceByKey("oneTaskProcess", scenarioName);
            }