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

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 8aa41cc27a2da3c15de05625f3184863a6637477
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue Dec 12 16:20:39 2023 +0100

    CAUSEWAY-3657: relax HiddenTypeFacet visibility for interfaces
---
 .../object/hidden/HiddenTypeFacetFromAuthorization.java      | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/hidden/HiddenTypeFacetFromAuthorization.java
 
b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/hidden/HiddenTypeFacetFromAuthorization.java
index 0cfb61c984..5843d8727d 100644
--- 
a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/hidden/HiddenTypeFacetFromAuthorization.java
+++ 
b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/hidden/HiddenTypeFacetFromAuthorization.java
@@ -48,6 +48,18 @@ implements HiddenTypeFacet {
             return null;
         }
 
+        /*[CAUSEWAY-3657] Don't hide members based on their element type 
having no visible actions,
+         * properties or collections in case the element type is an interface.
+         *
+         * I encountered a case, where an interface type was visible during 
PROTOTYPING, but hidden in production.
+         * This is because the check for visibility also considers mixed in 
members,
+         * and it is the case that any interface when PROTOTYPING has some 
Object_ actions mixed in,
+         * but not necessarily in production.
+         */
+        if(spec.getCorrespondingClass().isInterface()) {
+            return null;
+        }
+
         val hasVisibleProperty = spec.streamProperties(MixedIn.INCLUDED)
                 .anyMatch(prop -> !AuthorizationFacet.hidesProperty(prop, vc));
 

Reply via email to