protected boolean tenantIdIsSame(final TaskEntity otherTask) { final String otherTenantId = otherTask.getTenantId(); if(otherTenantId == null) { return tenantId == null; } else { return otherTenantId.equals(tenantId); } }
protected boolean tenantIdIsSame(final TaskEntity otherTask) { final String otherTenantId = otherTask.getTenantId(); if(otherTenantId == null) { return tenantId == null; } else { return otherTenantId.equals(tenantId); } }
protected void propagateParentTaskTenantId() { if (parentTaskId != null) { final TaskEntity parentTask = Context .getCommandContext() .getTaskManager() .findTaskById(parentTaskId); if(tenantId != null && !tenantIdIsSame(parentTask)) { throw LOG.cannotSetDifferentTenantIdOnSubtask(parentTaskId, parentTask.getTenantId(), tenantId); } setTenantId(parentTask.getTenantId()); } }
protected void propagateParentTaskTenantId() { if (parentTaskId != null) { final TaskEntity parentTask = Context .getCommandContext() .getTaskManager() .findTaskById(parentTaskId); if(tenantId != null && !tenantIdIsSame(parentTask)) { throw LOG.cannotSetDifferentTenantIdOnSubtask(parentTaskId, parentTask.getTenantId(), tenantId); } setTenantId(parentTask.getTenantId()); } }
@Override public void checkDeleteTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("delete the task '"+ task.getId() + "'"); } }
public void checkTaskAssign(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("assign the task '"+ task.getId() + "'"); } }
public void checkReadTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("read the task '"+ task.getId() + "'"); } }
@Override public void checkUpdateTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the task '"+ task.getId() + "'"); } }
public void checkTaskWork(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("work on task '"+ task.getId() +"'"); } }
@Override public void checkUpdateTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the task '"+ task.getId() + "'"); } }
public void checkReadTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("read the task '"+ task.getId() + "'"); } }
@Override public void checkDeleteTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("delete the task '"+ task.getId() + "'"); } }
public void checkTaskAssign(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("assign the task '"+ task.getId() + "'"); } }
public void checkCreateTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("create the task '"+ task.getId() + "'"); } }
public void checkCreateTask(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("create the task '"+ task.getId() + "'"); } }
public void checkTaskWork(TaskEntity task) { if (task != null && !getTenantManager().isAuthenticatedTenant(task.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("work on task '"+ task.getId() +"'"); } }
public IdentityLinkEntity newIdentityLink(String userId, String groupId, String type) { IdentityLinkEntity identityLinkEntity = new IdentityLinkEntity(); identityLinkEntity.setTask(this); identityLinkEntity.setUserId(userId); identityLinkEntity.setGroupId(groupId); identityLinkEntity.setType(type); identityLinkEntity.setTenantId(getTenantId()); return identityLinkEntity; }
public IdentityLinkEntity newIdentityLink(String userId, String groupId, String type) { IdentityLinkEntity identityLinkEntity = new IdentityLinkEntity(); identityLinkEntity.setTask(this); identityLinkEntity.setUserId(userId); identityLinkEntity.setGroupId(groupId); identityLinkEntity.setType(type); identityLinkEntity.setTenantId(getTenantId()); return identityLinkEntity; }
public void setTask(TaskEntity task) { if (task != null) { this.taskId = task.getId(); this.tenantId = task.getTenantId(); if (task.getExecution() != null) { setExecution(task.getExecution()); } if (task.getCaseExecution() != null) { setCaseExecution(task.getCaseExecution()); } } else { this.taskId = null; this.tenantId = null; setExecution(null); setCaseExecution(null); } }
public void setTask(TaskEntity task) { if (task != null) { this.taskId = task.getId(); this.tenantId = task.getTenantId(); if (task.getExecution() != null) { setExecution(task.getExecution()); } if (task.getCaseExecution() != null) { setCaseExecution(task.getCaseExecution()); } } else { this.taskId = null; this.tenantId = null; setExecution(null); setCaseExecution(null); } }