Skip to content

Commit

Permalink
Fix #6124 Permissions lost when doing something transactional in the …
Browse files Browse the repository at this point in the history
…afterCommit handler of a Job
  • Loading branch information
fdlk committed Apr 26, 2017
1 parent 29a5152 commit 7738c50
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions molgenis-jobs/src/main/java/org/molgenis/data/jobs/Job.java
Expand Up @@ -30,19 +30,23 @@ public Job(Progress progress, TransactionTemplate transactionTemplate, Authentic

@Override
public Result call()
{
if (transactionTemplate != null)
{
return transactionTemplate.execute((status) -> doCallInTransaction());
}
else
{
return doCallInTransaction();
}
}

private Result doCallInTransaction()
{
progress.start();
try
{
Result result;
if (transactionTemplate != null)
{
result = transactionTemplate.execute((status) -> tryRunWithAuthentication());
}
else
{
result = tryRunWithAuthentication();
}
Result result = tryRunWithAuthentication();
progress.success();
return result;
}
Expand Down

0 comments on commit 7738c50

Please sign in to comment.