User -> portal, Admin -> admin
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
parent
f105d0e1ab
commit
cbec25cd6b
@ -36,6 +36,7 @@ public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
|
|||||||
http
|
http
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.antMatchers("/portal").hasAuthority("devel-user")
|
.antMatchers("/portal").hasAuthority("devel-user")
|
||||||
|
.antMatchers("/admin").hasAuthority("devel-admins")
|
||||||
.anyRequest().permitAll();
|
.anyRequest().permitAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public class WebApplication {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/portal")
|
@GetMapping("/admin")
|
||||||
public String portal(Model model) throws pubshError {
|
public String portal(Model model) throws pubshError {
|
||||||
KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken)
|
KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken)
|
||||||
SecurityContextHolder.getContext().getAuthentication();
|
SecurityContextHolder.getContext().getAuthentication();
|
||||||
@ -101,10 +101,10 @@ public class WebApplication {
|
|||||||
model.addAttribute("availableOs", availableOs);
|
model.addAttribute("availableOs", availableOs);
|
||||||
//model.addAttribute("osChoice", new String());
|
//model.addAttribute("osChoice", new String());
|
||||||
|
|
||||||
return("portal");
|
return("admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/user")
|
@GetMapping("/portal")
|
||||||
public String user(Model model) throws pubshError {
|
public String user(Model model) throws pubshError {
|
||||||
KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken)
|
KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken)
|
||||||
SecurityContextHolder.getContext().getAuthentication();
|
SecurityContextHolder.getContext().getAuthentication();
|
||||||
@ -146,7 +146,7 @@ public class WebApplication {
|
|||||||
model.addAttribute("docker_containers", containers);
|
model.addAttribute("docker_containers", containers);
|
||||||
model.addAttribute("availableOs", availableOs);
|
model.addAttribute("availableOs", availableOs);
|
||||||
|
|
||||||
return("user");
|
return("portal");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/frontend/container/delete/{id}")
|
@DeleteMapping("/frontend/container/delete/{id}")
|
||||||
|
@ -41,6 +41,9 @@
|
|||||||
<button class="btn btn-primary" th:id="request_submission" th:type="submit">Generate</button>
|
<button class="btn btn-primary" th:id="request_submission" th:type="submit">Generate</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Existing containers:</h2>
|
<h2>Existing containers:</h2>
|
||||||
<table>
|
<table>
|
||||||
<tr th:each="container: ${docker_containers}">
|
<tr th:each="container: ${docker_containers}">
|
||||||
@ -48,15 +51,35 @@
|
|||||||
<td th:text="${container.image}" />
|
<td th:text="${container.image}" />
|
||||||
<td th:text="${container.id}" />
|
<td th:text="${container.id}" />
|
||||||
<td th:text="${container.status}" />
|
<td th:text="${container.status}" />
|
||||||
|
<!-- td><form id="deletion_pseudoform" action="#" th:action="@{'/frontend/container/delete/{id}'(id=${container.id})}" th:method="delete" >
|
||||||
|
<input type="hidden" name="_method" value="delete" />
|
||||||
|
<button id="deletion_submission" type="submit">Delete</button>
|
||||||
|
</form></td-->
|
||||||
<td>
|
<td>
|
||||||
<form id="deletion_pseudoform" action="#" th:action="@{'/frontend/container/delete/{id}'(id=${container.id})}" th:method="delete" th:containerid="${container.id}" th:containerShaSum="${container.imageId}" th:onsubmit="return confirm('Do you really want to delete the container with ID ' + this.getAttribute('containerid') + ' which is attached to the image with checksum ' + this.getAttribute('containerShaSum') + ' ?');">
|
<form id="deletion_pseudoform" action="#" th:action="@{'/frontend/container/delete/{id}'(id=${container.id})}" th:method="delete" th:containerid="${container.id}" th:containerShaSum="${container.imageId}" th:onsubmit="return confirm('Do you really want to delete the container with ID ' + this.getAttribute('containerid') + ' which is attached to the image with checksum ' + this.getAttribute('containerShaSum') + ' ?');">
|
||||||
|
<!--a
|
||||||
|
href=""
|
||||||
|
class="btn btn-danger "
|
||||||
|
th:data-confirm-delete="|Are you sure you want to delete the container with ID ${container.id}?|"
|
||||||
|
onclick="if (!confirm(this.getAttribute('data-confirm-delete'))) return false"
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</a-->
|
||||||
<button class="btn btn-danger" id="deletion_submission" type="submit">Delete</button>
|
<button class="btn btn-danger" id="deletion_submission" type="submit">Delete</button>
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
|
<!-- th:data-confirm-delete="|Are you sure you want to delete this employee ${tempEmployee.firstName}?|"
|
||||||
|
onclick="if (!confirm(this.getAttribute('data-confirm-delete'))) return false" -->
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--div id="pagefoot" th:include="layout :: footerFragment">Footer</div-->
|
||||||
<p></p>
|
<p></p>
|
||||||
<a href="/logout">Logout</a>
|
<a href="/logout">Logout</a>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- container -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -41,9 +41,6 @@
|
|||||||
<button class="btn btn-primary" th:id="request_submission" th:type="submit">Generate</button>
|
<button class="btn btn-primary" th:id="request_submission" th:type="submit">Generate</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Existing containers:</h2>
|
<h2>Existing containers:</h2>
|
||||||
<table>
|
<table>
|
||||||
<tr th:each="container: ${docker_containers}">
|
<tr th:each="container: ${docker_containers}">
|
||||||
@ -51,35 +48,15 @@
|
|||||||
<td th:text="${container.image}" />
|
<td th:text="${container.image}" />
|
||||||
<td th:text="${container.id}" />
|
<td th:text="${container.id}" />
|
||||||
<td th:text="${container.status}" />
|
<td th:text="${container.status}" />
|
||||||
<!-- td><form id="deletion_pseudoform" action="#" th:action="@{'/frontend/container/delete/{id}'(id=${container.id})}" th:method="delete" >
|
|
||||||
<input type="hidden" name="_method" value="delete" />
|
|
||||||
<button id="deletion_submission" type="submit">Delete</button>
|
|
||||||
</form></td-->
|
|
||||||
<td>
|
<td>
|
||||||
<form id="deletion_pseudoform" action="#" th:action="@{'/frontend/container/delete/{id}'(id=${container.id})}" th:method="delete" th:containerid="${container.id}" th:containerShaSum="${container.imageId}" th:onsubmit="return confirm('Do you really want to delete the container with ID ' + this.getAttribute('containerid') + ' which is attached to the image with checksum ' + this.getAttribute('containerShaSum') + ' ?');">
|
<form id="deletion_pseudoform" action="#" th:action="@{'/frontend/container/delete/{id}'(id=${container.id})}" th:method="delete" th:containerid="${container.id}" th:containerShaSum="${container.imageId}" th:onsubmit="return confirm('Do you really want to delete the container with ID ' + this.getAttribute('containerid') + ' which is attached to the image with checksum ' + this.getAttribute('containerShaSum') + ' ?');">
|
||||||
<!--a
|
|
||||||
href=""
|
|
||||||
class="btn btn-danger "
|
|
||||||
th:data-confirm-delete="|Are you sure you want to delete the container with ID ${container.id}?|"
|
|
||||||
onclick="if (!confirm(this.getAttribute('data-confirm-delete'))) return false"
|
|
||||||
>
|
|
||||||
Delete
|
|
||||||
</a-->
|
|
||||||
<button class="btn btn-danger" id="deletion_submission" type="submit">Delete</button>
|
<button class="btn btn-danger" id="deletion_submission" type="submit">Delete</button>
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
<!-- th:data-confirm-delete="|Are you sure you want to delete this employee ${tempEmployee.firstName}?|"
|
|
||||||
onclick="if (!confirm(this.getAttribute('data-confirm-delete'))) return false" -->
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--div id="pagefoot" th:include="layout :: footerFragment">Footer</div-->
|
|
||||||
<p></p>
|
<p></p>
|
||||||
<a href="/logout">Logout</a>
|
<a href="/logout">Logout</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- container -->
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user