Record Class ControlPanelSecurityConfiguration
java.lang.Object
java.lang.Record
io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration
- Record Components:
access- the configured read access moderole- role required when authorized read access is enabledwriteAccess- the configured write access modewriteRole- role required when authorized write access is enabled
@ConfigurationProperties("micronaut.control-panel.security")
public record ControlPanelSecurityConfiguration(io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Access access, String role, io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.WriteAccess writeAccess, @Nullable String writeRole)
extends Record
Security configuration for the control panel HTTP surface.
- Since:
- 2.0.0
- Author:
- Álvaro Sánchez-Mariscal
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionControlPanelSecurityConfiguration(io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Access access) Creates configuration with the default control panel role.ControlPanelSecurityConfiguration(io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Access access, String role) Creates configuration with inherited write access.ControlPanelSecurityConfiguration(io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Access access, String role, io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.WriteAccess writeAccess, @Nullable String writeRole) Creates an instance of aControlPanelSecurityConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Accessaccess()Returns the value of theaccessrecord component.Resolve the effective write role.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.role()Returns the value of therolerecord component.final StringtoString()Returns a string representation of this record class.io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.WriteAccessReturns the value of thewriteAccessrecord component.@Nullable StringReturns the value of thewriteRolerecord component.
-
Field Details
-
PREFIX
- See Also:
-
PROPERTY_ACCESS
- See Also:
-
PROPERTY_ROLE
- See Also:
-
PROPERTY_WRITE_ACCESS
- See Also:
-
PROPERTY_WRITE_ROLE
- See Also:
-
DEFAULT_ACCESS
- See Also:
-
DEFAULT_ROLE
- See Also:
-
DEFAULT_WRITE_ACCESS
- See Also:
-
-
Constructor Details
-
ControlPanelSecurityConfiguration
public ControlPanelSecurityConfiguration(io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Access access) Creates configuration with the default control panel role.- Parameters:
access- the configured access mode
-
ControlPanelSecurityConfiguration
public ControlPanelSecurityConfiguration(io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Access access, String role) Creates configuration with inherited write access.- Parameters:
access- the configured read access moderole- the configured read role
-
ControlPanelSecurityConfiguration
public ControlPanelSecurityConfiguration(@Bindable(defaultValue="AUTHORIZED") io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.Access access, @Bindable(defaultValue="ROLE_CONTROL_PANEL") String role, @Bindable(defaultValue="INHERITED") io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.WriteAccess writeAccess, @Nullable String writeRole) Creates an instance of aControlPanelSecurityConfigurationrecord class.- Parameters:
access- the value for theaccessrecord componentrole- the value for therolerecord componentwriteAccess- the value for thewriteAccessrecord componentwriteRole- the value for thewriteRolerecord component
-
-
Method Details
-
effectiveWriteRole
Resolve the effective write role.- Returns:
- the write role, falling back to the read role when no write role is configured
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
access
-
role
-
writeAccess
@Bindable(defaultValue="INHERITED") public io.micronaut.controlpanel.core.security.ControlPanelSecurityConfiguration.WriteAccess writeAccess()Returns the value of thewriteAccessrecord component.- Returns:
- the value of the
writeAccessrecord component
-
writeRole
-