org.springframework.cloud.dataflow.rest.resource.about

## Class SecurityInfo

- java.lang.Object
- - org.springframework.cloud.dataflow.rest.resource.about.SecurityInfo

-     public class SecurityInfo
      extends Object

  Provides security related meta-information. E.g. is security enabled, username, roles etc.
  Author:
    Gunnar Hillert

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SecurityInfo()` Default constructor for serialization frameworks.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SecurityInfo` | `addRole(String role)`
    `List<String>` | `getRoles()`
    `String` | `getUsername()`
    `boolean` | `isAuthenticated()`
    `boolean` | `isAuthenticationEnabled()`
    `void` | `setAuthenticated(boolean authenticated)`
    `void` | `setAuthenticationEnabled(boolean authenticationEnabled)`
    `void` | `setRoles(List<String> roles)`
    `void` | `setUsername(String username)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SecurityInfo

          public SecurityInfo()

      Default constructor for serialization frameworks.

  - ### Method Detail

    - #### 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

          public String getUsername()

      Returns:
        The username of the authenticated user, null otherwise.

    - #### setUsername

          public void setUsername(String username)

    - #### getRoles

          public List<String> getRoles()

      Returns:
        List of Roles, if no roles are associated, an empty collection is returned.

    - #### setRoles

          public void setRoles(List<String> roles)

    - #### addRole

          public SecurityInfo addRole(String role)

      Parameters:
        `role` - Adds the role to `roles`
      Returns:
        the security related meta-information

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.