コード例 #1
0
        public virtual void testNewTaskAssignee()
        {
            // given
            MyResourceAuthorizationProvider.clearProperties();

            createGrantAuthorization(TASK, ANY, ALL, userId);

            string taskId  = "myTask";
            Task   newTask = taskService.newTask(taskId);

            taskService.saveTask(newTask);

            // when (1)
            taskService.setAssignee(taskId, "demo");

            // then (1)
            assertNull(MyResourceAuthorizationProvider.OLD_ASSIGNEE);
            assertEquals("demo", MyResourceAuthorizationProvider.NEW_ASSIGNEE);

            MyResourceAuthorizationProvider.clearProperties();

            // when (2)
            taskService.setAssignee(taskId, userId);

            // then (2)
            assertEquals("demo", MyResourceAuthorizationProvider.OLD_ASSIGNEE);
            assertEquals(userId, MyResourceAuthorizationProvider.NEW_ASSIGNEE);

            taskService.deleteTask(taskId, true);
        }
コード例 #2
0
        public virtual void testAddGroupIdentityLink()
        {
            // given
            MyResourceAuthorizationProvider.clearProperties();

            createGrantAuthorization(TASK, ANY, ALL, userId);

            string taskId  = "myTask";
            Task   newTask = taskService.newTask(taskId);

            taskService.saveTask(newTask);

            // when
            taskService.addGroupIdentityLink(taskId, "management", "myIdentityLink");

            // then
            assertEquals("myIdentityLink", MyResourceAuthorizationProvider.ADD_GROUP_IDENTITY_LINK_TYPE);
            assertEquals("management", MyResourceAuthorizationProvider.ADD_GROUP_IDENTITY_LINK_GROUP);

            taskService.deleteTask(taskId, true);
        }
コード例 #3
0
        public virtual void testAddCandidateUser()
        {
            // given
            MyResourceAuthorizationProvider.clearProperties();

            createGrantAuthorization(TASK, ANY, ALL, userId);

            string taskId  = "myTask";
            Task   newTask = taskService.newTask(taskId);

            taskService.saveTask(newTask);

            // when
            taskService.addCandidateUser(taskId, "demo");

            // then
            assertEquals(IdentityLinkType.CANDIDATE, MyResourceAuthorizationProvider.ADD_USER_IDENTITY_LINK_TYPE);
            assertEquals("demo", MyResourceAuthorizationProvider.ADD_USER_IDENTITY_LINK_USER);

            taskService.deleteTask(taskId, true);
        }