This commit is contained in:
René Pfeuffer
2018-10-17 13:25:07 +02:00
parent 9bfb2cdadb
commit 3c7df066f0
5 changed files with 12 additions and 53 deletions

View File

@@ -35,11 +35,8 @@ package sonia.scm;
//~--- JDK imports ------------------------------------------------------------
import com.github.sdorra.ssp.PermissionCheck;
import java.io.Closeable;
import java.io.IOException;
import java.util.function.Function;
/**
* The base class of all handlers.
@@ -78,15 +75,4 @@ public interface HandlerBase<T extends TypedObject>
* @throws IOException
*/
void modify(T object) throws NotFoundException;
/**
* Modifies a persistent object after checking with the given permission checker.
*
* @param object to modify
* @param permissionChecker check permission before to modify
* @throws IOException
*/
default void modify(T object, Function<T, PermissionCheck> permissionChecker) throws NotFoundException{
modify(object);
}
}

View File

@@ -1,12 +0,0 @@
package sonia.scm.util;
import org.apache.shiro.SecurityUtils;
public class AuthenticationUtil {
public static String getAuthenticatedUsername() {
Object subject = SecurityUtils.getSubject().getPrincipal();
AssertUtil.assertIsNotNull(subject);
return subject.toString();
}
}