[Fix] throw exception after logging in StrolchSystemAction

This commit is contained in:
Robert von Burg 2018-05-16 17:52:44 +02:00
parent 1e616f0616
commit 710a989ce5
2 changed files with 8 additions and 11 deletions

View File

@ -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;
}
}
}

View File

@ -1,12 +1,12 @@
/*
* Copyright 2013 Robert von Burg <eitch@eitchnet.ch>
*
*
* 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 <eitch@eitchnet.ch>
*/
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);
}