예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryList()
        public virtual void testQueryList()
        {
            // given
            authRule.createGrantAuthorization(Resources.BATCH, batch1.Id, "user", Permissions.READ);

            // when
            authRule.enableAuthorization("user");
            IList <Batch> batches = engineRule.ManagementService.createBatchQuery().list();

            authRule.disableAuthorization();

            // then
            Assert.assertEquals(1, batches.Count);
            Assert.assertEquals(batch1.Id, batches[0].Id);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testIsUserAuthorizedForIgnoredPermission()
        public virtual void testIsUserAuthorizedForIgnoredPermission()
        {
            // given
            processEngineConfiguration.DisabledPermissions = Arrays.asList(READ.name());

            authRule.createGrantAuthorization(PROCESS_INSTANCE, ANY, USER_ID, ProcessInstancePermissions.RETRY_JOB);

            authRule.enableAuthorization(USER_ID);

            // expected exception
            exceptionRule.expect(typeof(BadUserRequestException));
            exceptionRule.expectMessage("The 'READ' permission is disabled, please check your process engine configuration.");

            // when
            authorizationService.isUserAuthorized(USER_ID, null, READ, PROCESS_DEFINITION);
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryList()
        public virtual void testQueryList()
        {
            // given
            authRule.createGrantAuthorization(Resources.BATCH, batch1.Id, "user", Permissions.READ);

            // when
            authRule.enableAuthorization("user");
            IList <BatchStatistics> batches = engineRule.ManagementService.createBatchStatisticsQuery().list();

            authRule.disableAuthorization();

            // then
            Assert.assertEquals(1, batches.Count);
            Assert.assertEquals(batch1.Id, batches[0].Id);

            // and the visibility of jobs is not restricted
            Assert.assertEquals(1, batches[0].JobsCreated);
            Assert.assertEquals(1, batches[0].RemainingJobs);
            Assert.assertEquals(1, batches[0].TotalJobs);
        }