Package io.jmix.security.user
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 Summary
FieldsModifier and TypeFieldDescriptionprotected Metadataprotected final ConcurrentHashMap<Class<?>, Optional<MetaProperty>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable MetaPropertyfindFlagProperty(Class<?> userClass) booleanisPasswordChangeRequired(@Nullable Object user) protected Optional<MetaProperty> lookupFlagProperty(Class<?> userClass) voidsetPasswordChangeRequired(Object user, boolean value) Sets the value of the field marked withPasswordChangeRequiredon the given user.
-
Field Details
-
metadata
-
propertyCache
-
-
Constructor Details
-
PasswordChangeRequiredSupport
public PasswordChangeRequiredSupport()
-
-
Method Details
-
findFlagProperty
- Returns:
- the
MetaPropertycorresponding to the field marked withPasswordChangeRequiredin the given user class, ornullif the class does not have such a field, or the field is not registered in the metamodel
-
isPasswordChangeRequired
- Returns:
trueif the given user has the field marked withPasswordChangeRequiredand its value istrue
-
setPasswordChangeRequired
Sets the value of the field marked withPasswordChangeRequiredon the given user. Does nothing if the user is not a Jmix entity or does not have such a field. -
lookupFlagProperty
-