-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
@@ -111,8 +117,9 @@ private InputToModelParseResult validate(Map<String, Object> inputMap){ | |||
for(Map.Entry<String, Object> entry : inputMap.entrySet()){ | |||
if(entry.getKey().equals("firstname")) continue; | |||
if(entry.getKey().equals("position")) continue; | |||
if(entry.getKey().equals("permission")&& entry.getValue() instanceof Permission) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you not validate the permission value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it validated with StringValidator? because if its empty, its added to failed inputs, as shown in the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, sorry misread it. Except now you cannot edit a user because it doesn't see permission as valid
I also get an error trying to update a user: "permission required" |
@@ -60,7 +60,13 @@ private Staff parseUser(Map<String, Object> inputMap){ | |||
String lastname = (String) inputMap.get("lastname"); | |||
String department = (String) inputMap.get("department"); | |||
String position = (String) inputMap.get("position"); | |||
Permission permission = (Permission) inputMap.get("permission"); | |||
Permission permission; | |||
try{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be indented one less step
Merged |
No description provided.