Initial commit: update

This commit is contained in:
chris
2026-10-21 19:34:42 +00:00
parent 1814ea3a0f
commit 67a7fb6385
103 changed files with 3366 additions and 780 deletions

View File

@@ -33,13 +33,13 @@ import org.json.JSONObject;
<span class="nc" id="L33">public class HmiLegacyWidgetResource {</span>
<span class="nc" id="L34"> private static final Logger LOG=Logger.getLogger(HmiLegacyWidgetResource.class.getName());</span>
<span class="nc" id="L35"> private static final DBService DB=new DBService(&quot;dsMesMiiNJTA&quot;);</span>
@Context private SecurityContext security;
@Context private javax.servlet.http.HttpServletRequest request;
<span class="nc" id="L37"> private Response error(int code,String text){return Response.status(code).type(MediaType.APPLICATION_JSON).entity(new JSONObject().put(&quot;error&quot;,text).toString()).build();}</span>
<span class="nc bnc" id="L38" title="All 6 branches missed."> private boolean privileged(){return security.isUserInRole(&quot;hmi-admin&quot;)||security.isUserInRole(&quot;hmi-designer&quot;)||security.isUserInRole(&quot;hmi-publisher&quot;);}</span>
<span class="nc" id="L38"> private boolean privileged(){return HmiAuth.designer(request);}</span>
@GET @Path(&quot;{source}&quot;)
public Response get(@PathParam(&quot;source&quot;)String source,@QueryParam(&quot;station&quot;)String station) {
<span class="nc bnc" id="L42" title="All 4 branches missed."> if(security==null||security.getUserPrincipal()==null)return error(401,&quot;Anmeldung erforderlich&quot;);</span>
<span class="nc bnc" id="L42" title="All 2 branches missed."> if(HmiAuth.user(request)==null)return error(401,&quot;Anmeldung erforderlich&quot;);</span>
<span class="nc bnc" id="L43" title="All 4 branches missed."> if(station==null||!station.matches(&quot;[A-Za-z0-9_.-]{1,100}&quot;))return error(400,&quot;Ungültige Stationsnummer&quot;);</span>
<span class="nc bnc" id="L44" title="All 6 branches missed."> if((&quot;station-config&quot;.equals(source)||&quot;users&quot;.equals(source))&amp;&amp;!privileged())return error(403,&quot;HMI-Designer-Berechtigung erforderlich&quot;);</span>
final String query;