[Minor] firstname and lastname are not required for SYSTEM users
This commit is contained in:
parent
828d725a69
commit
b47d3e3dcd
|
@ -90,15 +90,17 @@ public class UserRep implements Serializable {
|
|||
if (StringHelper.isEmpty(this.username))
|
||||
throw new PrivilegeException("username is null or empty"); //$NON-NLS-1$
|
||||
|
||||
if (StringHelper.isEmpty(this.firstname))
|
||||
throw new PrivilegeException("firstname is null or empty"); //$NON-NLS-1$
|
||||
|
||||
if (StringHelper.isEmpty(this.surname))
|
||||
throw new PrivilegeException("surname is null or empty"); //$NON-NLS-1$
|
||||
|
||||
if (this.userState == null)
|
||||
throw new PrivilegeException("userState is null"); //$NON-NLS-1$
|
||||
|
||||
if (this.userState != UserState.SYSTEM) {
|
||||
if (StringHelper.isEmpty(this.firstname))
|
||||
throw new PrivilegeException("firstname is null or empty"); //$NON-NLS-1$
|
||||
|
||||
if (StringHelper.isEmpty(this.surname))
|
||||
throw new PrivilegeException("surname is null or empty"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (this.roles == null)
|
||||
throw new PrivilegeException("roles is null"); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -84,17 +84,19 @@ public final class User {
|
|||
if (StringHelper.isEmpty(userId)) {
|
||||
throw new PrivilegeException("No UserId defined!"); //$NON-NLS-1$
|
||||
}
|
||||
if (userState == null) {
|
||||
throw new PrivilegeException("No userState defined!"); //$NON-NLS-1$
|
||||
}
|
||||
if (StringHelper.isEmpty(username)) {
|
||||
throw new PrivilegeException("No username defined!"); //$NON-NLS-1$
|
||||
}
|
||||
if (StringHelper.isEmpty(firstname)) {
|
||||
throw new PrivilegeException("No firstname defined!"); //$NON-NLS-1$
|
||||
}
|
||||
if (StringHelper.isEmpty(surname)) {
|
||||
throw new PrivilegeException("No surname defined!"); //$NON-NLS-1$
|
||||
}
|
||||
if (userState == null) {
|
||||
throw new PrivilegeException("No userState defined!"); //$NON-NLS-1$
|
||||
if (userState != UserState.SYSTEM) {
|
||||
if (StringHelper.isEmpty(surname)) {
|
||||
throw new PrivilegeException("No surname defined!"); //$NON-NLS-1$
|
||||
}
|
||||
if (StringHelper.isEmpty(firstname)) {
|
||||
throw new PrivilegeException("No firstname defined!"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
// password may be null, meaning not able to login
|
||||
|
|
Loading…
Reference in New Issue