remove logout link when authenticated as _anonymous user

This commit is contained in:
Eduard Heimbuch
2019-10-10 14:05:34 +02:00
parent f0311eb138
commit 1162b353db
2 changed files with 4 additions and 5 deletions

View File

@@ -46,13 +46,12 @@ public class IndexDtoGenerator extends HalAppenderMapper {
}
if (SecurityUtils.getSubject().isAuthenticated()) {
builder.single(
link("me", resourceLinks.me().self()),
link("logout", resourceLinks.authentication().logout())
);
builder.single(link("me", resourceLinks.me().self()));
if (SecurityUtils.getSubject().getPrincipal().equals(SCMContext.USER_ANONYMOUS)) {
builder.single(link("login", resourceLinks.authentication().jsonLogin()));
} else {
builder.single(link("logout", resourceLinks.authentication().logout()));
}
if (PluginPermissions.read().isPermitted()) {