@Test void testIsAllowedJobExecutionEntityTypeReadDataPermissions() { when(jobMetaDataMetaData.getId()).thenReturn("sys_job_JobExecution"); EntityType entityType = when(mock(EntityType.class).getId()).thenReturn("MyJobExecution").getMock(); EntityType extendsEntityType = when(mock(EntityType.class).getId()).thenReturn("sys_job_JobExecution").getMock(); when(entityType.getExtends()).thenReturn(extendsEntityType); when(userPermissionEvaluator.hasPermission(new EntityTypeIdentity(entityType), READ_DATA)) .thenReturn(true); assertTrue(jobsController.isAllowedJobExecutionEntityType(entityType)); }
boolean isAllowedJobExecutionEntityType(EntityType entityType) { return isJobExecutionEntityType(entityType) && currentUserCanReadEntityTypeData(entityType); }
JobsController extends PluginController { boolean isAllowedJobExecutionEntityType(EntityType entityType) { return isJobExecutionEntityType(entityType) && currentUserCanReadEntityTypeData(entityType); } }
JobsController extends PluginController { boolean isAllowedJobExecutionEntityType(EntityType entityType) { return isJobExecutionEntityType(entityType) && currentUserCanReadEntityTypeData(entityType); } JobsController(
      JobsService jobsService,
      UserAccountService userAccountService,
      DataService dataService,
      JobExecutionMetaData jobMetaDataMetaData,
      JobScheduler jobScheduler,
      MenuReaderService menuReaderService,
      UserPermissionEvaluator userPermissionEvaluator); }
JobsController extends PluginController { boolean isAllowedJobExecutionEntityType(EntityType entityType) { return isJobExecutionEntityType(entityType) && currentUserCanReadEntityTypeData(entityType); } JobsController(
      JobsService jobsService,
      UserAccountService userAccountService,
      DataService dataService,
      JobExecutionMetaData jobMetaDataMetaData,
      JobScheduler jobScheduler,
      MenuReaderService menuReaderService,
      UserPermissionEvaluator userPermissionEvaluator); @GetMapping String init(Model model); @GetMapping("/viewJob") String viewJob(
      Model model,
      @RequestParam(name = "jobHref") String jobHref,
      @RequestParam(name = "refreshTimeoutMillis", defaultValue = "10000")
          Integer refreshTimeoutMillis); @Transactional(readOnly = true) @GetMapping(value = "/latest", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody List<Entity> findLastJobs(); @PostMapping("/cancel/{jobExecutionType}/{jobExecutionId}") @ResponseStatus(NO_CONTENT) void cancel(
      @PathVariable("jobExecutionType") String jobExecutionType,
      @PathVariable("jobExecutionId") String jobExecutionId); @PostMapping("/run/{scheduledJobId}") @ResponseStatus(NO_CONTENT) void runNow(@PathVariable("scheduledJobId") String scheduledJobId); String createJobExecutionViewHref(String jobHref, int refreshTimeoutMillis); }
JobsController extends PluginController { boolean isAllowedJobExecutionEntityType(EntityType entityType) { return isJobExecutionEntityType(entityType) && currentUserCanReadEntityTypeData(entityType); } JobsController(
      JobsService jobsService,
      UserAccountService userAccountService,
      DataService dataService,
      JobExecutionMetaData jobMetaDataMetaData,
      JobScheduler jobScheduler,
      MenuReaderService menuReaderService,
      UserPermissionEvaluator userPermissionEvaluator); @GetMapping String init(Model model); @GetMapping("/viewJob") String viewJob(
      Model model,
      @RequestParam(name = "jobHref") String jobHref,
      @RequestParam(name = "refreshTimeoutMillis", defaultValue = "10000")
          Integer refreshTimeoutMillis); @Transactional(readOnly = true) @GetMapping(value = "/latest", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody List<Entity> findLastJobs(); @PostMapping("/cancel/{jobExecutionType}/{jobExecutionId}") @ResponseStatus(NO_CONTENT) void cancel(
      @PathVariable("jobExecutionType") String jobExecutionType,
      @PathVariable("jobExecutionId") String jobExecutionId); @PostMapping("/run/{scheduledJobId}") @ResponseStatus(NO_CONTENT) void runNow(@PathVariable("scheduledJobId") String scheduledJobId); String createJobExecutionViewHref(String jobHref, int refreshTimeoutMillis); static final String ID; static final String URI; }