Class PasswordChangeRequiredSupport

java.lang.Object
io.jmix.security.user.PasswordChangeRequiredSupport

@Component("sec_PasswordChangeRequiredSupport") public class PasswordChangeRequiredSupport extends Object
Helper for working with the user entity field marked with the PasswordChangeRequired annotation.

If the user entity does not have such a field, all methods of this class behave as no-ops: isPasswordChangeRequired(Object) returns false and setPasswordChangeRequired(Object, boolean) does nothing. This guarantees that the feature is fully optional and does not affect projects whose user entity is not annotated.

  • Field Details

  • Constructor Details

    • PasswordChangeRequiredSupport

      public PasswordChangeRequiredSupport()
  • Method Details

    • findFlagProperty

      public @Nullable MetaProperty findFlagProperty(Class<?> userClass)
      Returns:
      the MetaProperty corresponding to the field marked with PasswordChangeRequired in the given user class, or null if the class does not have such a field, or the field is not registered in the metamodel
    • isPasswordChangeRequired

      public boolean isPasswordChangeRequired(@Nullable Object user)
      Returns:
      true if the given user has the field marked with PasswordChangeRequired and its value is true
    • setPasswordChangeRequired

      public void setPasswordChangeRequired(Object user, boolean value)
      Sets the value of the field marked with PasswordChangeRequired on the given user. Does nothing if the user is not a Jmix entity or does not have such a field.
    • lookupFlagProperty

      protected Optional<MetaProperty> lookupFlagProperty(Class<?> userClass)