]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/SystemExecutionService.java
Improve security
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / SystemExecutionService.java
diff --git a/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/SystemExecutionService.java b/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/SystemExecutionService.java
new file mode 100644 (file)
index 0000000..f5ef357
--- /dev/null
@@ -0,0 +1,18 @@
+package org.argeo.security;
+
+import org.springframework.core.task.TaskExecutor;
+
+/**
+ * Allows to execute code authenticated as a system user (that is not a real
+ * person)
+ */
+public interface SystemExecutionService {
+       /**
+        * Executes this Runnable within a system authenticated context.
+        * Implementations should make sure that this method is properly secured via
+        * Java permissions since it could access to everything without credentials.
+        */
+       public void executeAsSystem(Runnable runnable);
+       
+       public TaskExecutor createSystemAuthenticatedTaskExecutor();
+}