You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2019/04/25 13:29:32 UTC

[isis] branch ISIS-2001-temp-mixin-for-testing created (now 5aae043)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch ISIS-2001-temp-mixin-for-testing
in repository https://gitbox.apache.org/repos/asf/isis.git.


      at 5aae043  ISIS-2001: (temporary) adds a mixin to reproduce issue

This branch includes the following new commits:

     new 5aae043  ISIS-2001: (temporary) adds a mixin to reproduce issue

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[isis] 01/01: ISIS-2001: (temporary) adds a mixin to reproduce issue

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2001-temp-mixin-for-testing
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 5aae043a582ff09fafcf21d2e9aaa061e4347738
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Apr 25 10:46:49 2019 +0100

    ISIS-2001: (temporary) adds a mixin to reproduce issue
---
 .../dom/impl/SimpleObject_impersonateUser.java     | 71 ++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObject_impersonateUser.java b/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObject_impersonateUser.java
new file mode 100644
index 0000000..5545ddd
--- /dev/null
+++ b/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObject_impersonateUser.java
@@ -0,0 +1,71 @@
+package domainapp.modules.simple.dom.impl;
+
+import java.util.List;
+
+import javax.annotation.Nullable;
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.CommandPersistence;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Mixin;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.RestrictTo;
+
+@Mixin(
+        method = "act"
+)
+public class SimpleObject_impersonateUser {
+    private final SimpleObject simpleObject;
+
+    public SimpleObject_impersonateUser(final SimpleObject simpleObject) {
+        this.simpleObject = simpleObject;
+    }
+
+    @Action(
+            restrictTo = RestrictTo.PROTOTYPING,
+            commandPersistence = CommandPersistence.NOT_PERSISTED
+    )
+    @MemberOrder(
+            sequence = "90.1"
+    )
+    public Object act(
+            //@Nullable
+            final SimpleObject applicationUser,
+            @ParameterLayout(describedAs = "If set, then the roles specified below are used.  Otherwise uses roles of the user.")
+            final boolean useExplicitRolesBelow,
+            @ParameterLayout(describedAs = "Only used if 'useExplicitRolesBelow' is set, otherwise is ignored.")
+            @Nullable final List<SimpleObject> applicationRoleList) {
+
+        return this.simpleObject;
+    }
+
+    public List<SimpleObject> choices0Act() {
+        return this.simpleObjects.listAll();
+    }
+    public SimpleObject default0Act() {
+        return simpleObject;
+    }
+
+    public boolean default1Act() {
+        return false;
+    }
+
+    public List<SimpleObject> choices2Act() {
+        return this.simpleObjects.listAll();
+    }
+    public List<SimpleObject> default2Act(final SimpleObject applicationUser) {
+        final List<SimpleObject> simpleObjects = this.simpleObjects.listAll();
+        if(applicationUser != null) {
+            simpleObjects.remove(applicationUser);
+        }
+        return simpleObjects;
+    }
+
+    public boolean hideAct() {
+        return false;
+    }
+
+    @Inject
+    SimpleObjects simpleObjects;
+}