Class SecurityInfoResource
java.lang.Object
org.springframework.hateoas.RepresentationModel
org.springframework.cloud.dataflow.rest.resource.security.SecurityInfoResource
public class SecurityInfoResource
extends org.springframework.hateoas.RepresentationModel
Provides security related meta-information. E.g. is security enabled, username, roles
etc.
- Author:
- Gunnar Hillert
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRoles()
boolean
boolean
void
setAuthenticated
(boolean authenticated) void
setAuthenticationEnabled
(boolean authenticationEnabled) void
void
setUsername
(String username) Methods inherited from class org.springframework.hateoas.RepresentationModel
add, add, add, addAllIf, addIf, equals, getLink, getLink, getLinks, getLinks, getLinks, getRequiredLink, getRequiredLink, hashCode, hasLink, hasLink, hasLinks, mapLink, mapLinkIf, of, of, removeLinks, toString
-
Constructor Details
-
SecurityInfoResource
public SecurityInfoResource()Default constructor for serialization frameworks.
-
-
Method Details
-
isAuthenticationEnabled
public boolean isAuthenticationEnabled()- Returns:
- true if the authentication feature is enabled, false otherwise
-
setAuthenticationEnabled
public void setAuthenticationEnabled(boolean authenticationEnabled) -
isAuthenticated
public boolean isAuthenticated()- Returns:
- True if the user is authenticated
-
setAuthenticated
public void setAuthenticated(boolean authenticated) -
getUsername
- Returns:
- The username of the authenticated user, null otherwise.
-
setUsername
-
getRoles
- Returns:
- List of Roles, if no roles are associated, an empty collection is returned.
-
setRoles
-
addRole
- Parameters:
role
- Adds the role toroles
- Returns:
- the resource with an additional role
-