mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
remove logout link when authenticated as _anonymous user
This commit is contained in:
@@ -39,7 +39,7 @@ import sonia.scm.user.User;
|
|||||||
import sonia.scm.util.ServiceUtil;
|
import sonia.scm.util.ServiceUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SCMConext searches a implementation of {@link SCMContextProvider} and
|
* The SCMContext searches a implementation of {@link SCMContextProvider} and
|
||||||
* holds a singleton instance of this implementation.
|
* holds a singleton instance of this implementation.
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
|
|||||||
@@ -46,13 +46,12 @@ public class IndexDtoGenerator extends HalAppenderMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SecurityUtils.getSubject().isAuthenticated()) {
|
if (SecurityUtils.getSubject().isAuthenticated()) {
|
||||||
builder.single(
|
builder.single(link("me", resourceLinks.me().self()));
|
||||||
link("me", resourceLinks.me().self()),
|
|
||||||
link("logout", resourceLinks.authentication().logout())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (SecurityUtils.getSubject().getPrincipal().equals(SCMContext.USER_ANONYMOUS)) {
|
if (SecurityUtils.getSubject().getPrincipal().equals(SCMContext.USER_ANONYMOUS)) {
|
||||||
builder.single(link("login", resourceLinks.authentication().jsonLogin()));
|
builder.single(link("login", resourceLinks.authentication().jsonLogin()));
|
||||||
|
} else {
|
||||||
|
builder.single(link("logout", resourceLinks.authentication().logout()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PluginPermissions.read().isPermitted()) {
|
if (PluginPermissions.read().isPermitted()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user