use of org.haiku.haikudepotserver.api1.model.authorization.job.QueueAuthorizationRulesSpreadsheetResult in project haikudepotserver by haiku.
the class AuthorizationJobApiImpl method queueAuthorizationRulesSpreadsheet.
@Override
public QueueAuthorizationRulesSpreadsheetResult queueAuthorizationRulesSpreadsheet(QueueAuthorizationRulesSpreadsheetRequest request) {
Preconditions.checkArgument(null != request, "a request objects is required");
final ObjectContext context = serverRuntime.newContext();
User user = obtainAuthenticatedUser(context);
if (!permissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), null, Permission.AUTHORIZATION_CONFIGURE)) {
String msg = "attempt to queue authorization spreadsheet without sufficient authorization";
LOGGER.warn(msg);
throw new AccessDeniedException(msg);
}
QueueAuthorizationRulesSpreadsheetResult result = new QueueAuthorizationRulesSpreadsheetResult();
result.guid = jobService.submit(new AuthorizationRulesSpreadsheetJobSpecification(), JobSnapshot.COALESCE_STATUSES_QUEUED_STARTED);
return result;
}
Aggregations