diff --git a/components/template/template-application-rest-java/src/main/resources/META-INF/dirigible/template-application-rest-java/api/EntityMyController.java.template b/components/template/template-application-rest-java/src/main/resources/META-INF/dirigible/template-application-rest-java/api/EntityMyController.java.template index c37c52b5ef7..96eb904391d 100644 --- a/components/template/template-application-rest-java/src/main/resources/META-INF/dirigible/template-application-rest-java/api/EntityMyController.java.template +++ b/components/template/template-application-rest-java/src/main/resources/META-INF/dirigible/template-application-rest-java/api/EntityMyController.java.template @@ -415,6 +415,16 @@ public class ${name}MyController { #end #end } + // The pre-check the generated UI gates its Edit affordances on: every guard this ${name} declares, + // in one answer. + private boolean isMutable(${name}Entity existing) { +#if($immutableAlways) + return false; +#else + return #if($immutableStatusProperty)isStatusMutable(existing)#{else}true#end#if($periodLock) && isPeriodOpen(existing.${periodLock.dateProperty})#end; +#end + } + #end #if($immutableStatusProperty && !$immutableAlways)