From 710a989ce5a5c014e5f578fce18c96c644a50dd5 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Wed, 16 May 2018 17:52:44 +0200 Subject: [PATCH] [Fix] throw exception after logging in StrolchSystemAction --- .../runtime/privilege/StrolchSystemAction.java | 1 + .../privilege/handler/SystemAction.java | 18 +++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/li.strolch.agent/src/main/java/li/strolch/runtime/privilege/StrolchSystemAction.java b/li.strolch.agent/src/main/java/li/strolch/runtime/privilege/StrolchSystemAction.java index 8f9d164f1..d73b779d2 100644 --- a/li.strolch.agent/src/main/java/li/strolch/runtime/privilege/StrolchSystemAction.java +++ b/li.strolch.agent/src/main/java/li/strolch/runtime/privilege/StrolchSystemAction.java @@ -27,6 +27,7 @@ public class StrolchSystemAction extends SystemAction { } catch (Exception e) { logger.error("Failed to execute SystemAction for " + privilegeContext.getUsername() + " due to " + e .getMessage(), e); + throw e; } } } diff --git a/li.strolch.privilege/src/main/java/li/strolch/privilege/handler/SystemAction.java b/li.strolch.privilege/src/main/java/li/strolch/privilege/handler/SystemAction.java index 8e8d1904d..c3d5d8817 100644 --- a/li.strolch.privilege/src/main/java/li/strolch/privilege/handler/SystemAction.java +++ b/li.strolch.privilege/src/main/java/li/strolch/privilege/handler/SystemAction.java @@ -1,12 +1,12 @@ /* * Copyright 2013 Robert von Burg - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,9 +21,8 @@ import li.strolch.privilege.model.Restrictable; /** * With this interface system actions, which are to be performed in an automated fashion, i.e. by cron jobs, can be - * implemented and then the authorized execution can be delegated to - * {@link PrivilegeHandler#runAsSystem(String, SystemAction)} - * + * implemented and then the authorized execution can be delegated to {@link PrivilegeHandler#runAs(String, SystemAction)} + * * @author Robert von Burg */ public abstract class SystemAction implements Restrictable { @@ -41,12 +40,9 @@ public abstract class SystemAction implements Restrictable { /** * This method will be called by the {@link PrivilegeHandler} when an authorized {@link Certificate} has been * generated to allow this action to properly validate its execution - * - * TODO: I'm not really happy with this... we might want to pass the certificate and then force the action to - * validate it to get the {@link PrivilegeContext} - we don't want the {@link PrivilegeContext} to live forever... - * + * * @param privilegeContext - * the {@link PrivilegeContext} which was generated for a valid system user + * the {@link PrivilegeContext} which was generated for a valid system user */ public abstract void execute(PrivilegeContext privilegeContext); }