protected internal virtual void checkReadProcessDefinition(ActivityStatisticsQueryImpl query) { CommandContext commandContext = CommandContext; if (AuthorizationEnabled && CurrentAuthentication != null && commandContext.AuthorizationCheckEnabled) { string processDefinitionId = query.ProcessDefinitionId; ProcessDefinitionEntity definition = ProcessDefinitionManager.findLatestProcessDefinitionById(processDefinitionId); ensureNotNull("no deployed process definition found with id '" + processDefinitionId + "'", "processDefinition", definition); AuthorizationManager.checkAuthorization(READ, PROCESS_DEFINITION, definition.Key); } }
public virtual void configureActivityStatisticsQuery(ActivityStatisticsQueryImpl query) { configureQuery(query); query.ProcessInstancePermissionChecks.Clear(); query.JobPermissionChecks.Clear(); query.IncidentPermissionChecks.Clear(); if (query.AuthCheck.AuthorizationCheckEnabled) { CompositePermissionCheck processInstancePermissionCheck = (new PermissionCheckBuilder()).disjunctive().atomicCheck(PROCESS_INSTANCE, "E.PROC_INST_ID_", READ).atomicCheck(PROCESS_DEFINITION, "P.KEY_", READ_INSTANCE).build(); // the following is need in order to evaluate whether to perform authCheck or not query.AuthCheck.PermissionChecks = processInstancePermissionCheck; // the actual check query.addProcessInstancePermissionCheck(processInstancePermissionCheck.AllPermissionChecks); if (query.FailedJobsToInclude) { CompositePermissionCheck jobPermissionCheck = (new PermissionCheckBuilder()).disjunctive().atomicCheck(PROCESS_INSTANCE, "JOB.PROCESS_INSTANCE_ID_", READ).atomicCheck(PROCESS_DEFINITION, "JOB.PROCESS_DEF_KEY_", READ_INSTANCE).build(); // the following is need in order to evaluate whether to perform authCheck or not query.AuthCheck.PermissionChecks = jobPermissionCheck; // the actual check query.addJobPermissionCheck(jobPermissionCheck.AllPermissionChecks); } if (query.IncidentsToInclude) { CompositePermissionCheck incidentPermissionCheck = (new PermissionCheckBuilder()).disjunctive().atomicCheck(PROCESS_INSTANCE, "I.PROC_INST_ID_", READ).atomicCheck(PROCESS_DEFINITION, "PROCDEF.KEY_", READ_INSTANCE).build(); // the following is need in order to evaluate whether to perform authCheck or not query.AuthCheck.PermissionChecks = incidentPermissionCheck; // the actual check query.addIncidentPermissionCheck(incidentPermissionCheck.AllPermissionChecks); } } }
public virtual long getStatisticsCountGroupedByActivity(ActivityStatisticsQueryImpl query) { configureQuery(query); return((long?)DbEntityManager.selectOne("selectActivityStatisticsCount", query).Value); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public java.util.List<org.camunda.bpm.engine.management.ActivityStatistics> getStatisticsGroupedByActivity(org.camunda.bpm.engine.impl.ActivityStatisticsQueryImpl query, org.camunda.bpm.engine.impl.Page page) public virtual IList <ActivityStatistics> getStatisticsGroupedByActivity(ActivityStatisticsQueryImpl query, Page page) { configureQuery(query); return(DbEntityManager.selectList("selectActivityStatistics", query, page)); }
protected internal virtual void configureQuery(ActivityStatisticsQueryImpl query) { checkReadProcessDefinition(query); AuthorizationManager.configureActivityStatisticsQuery(query); TenantManager.configureQuery(query); }