[Minor] firstname and lastname are not required for SYSTEM users

This commit is contained in:
Robert von Burg 2014-08-22 18:54:10 +02:00
parent 828d725a69
commit b47d3e3dcd
2 changed files with 18 additions and 14 deletions

View File

@ -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$
}

View File

@ -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