Restore a few missing fields on appsmith.user object (#7295)
With latest update, the following fields are unavailable on the `appsmith.user` object: - `accountNonExpired` - `accountNonLocked` - `credentialsNonExpired` - `isAnonymous` - `isEnabled` These fields are necessary for building applications and many apps were relying on these, despite them not being listed in the documentation at <https://docs.appsmith.com/framework-reference/appsmith#user>.
This commit is contained in:
parent
f18d58bb12
commit
9b98621010
|
|
@ -1,5 +1,6 @@
|
|||
package com.appsmith.server.dtos;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
|
@ -17,6 +18,24 @@ public class UserProfileDTO {
|
|||
|
||||
String gender;
|
||||
|
||||
@JsonProperty(value = "isAnonymous")
|
||||
boolean isAnonymous;
|
||||
|
||||
@JsonProperty(value = "isEnabled")
|
||||
boolean isEnabled;
|
||||
|
||||
boolean isEmptyInstance = false;
|
||||
|
||||
public boolean isAccountNonExpired() {
|
||||
return this.isEnabled;
|
||||
}
|
||||
|
||||
public boolean isAccountNonLocked() {
|
||||
return this.isEnabled;
|
||||
}
|
||||
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return this.isEnabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -865,6 +865,8 @@ public class UserServiceImpl extends BaseService<UserRepository, User, String> i
|
|||
profile.setName(user.getName());
|
||||
profile.setGender(user.getGender());
|
||||
profile.setEmptyInstance(isUsersEmpty);
|
||||
profile.setAnonymous(user.isAnonymous());
|
||||
profile.setEnabled(user.isEnabled());
|
||||
|
||||
return profile;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user