Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

admin view fix #40

Merged
merged 6 commits into from
Oct 18, 2015
Merged

admin view fix #40

merged 6 commits into from
Oct 18, 2015

Conversation

pawc
Copy link
Contributor

@pawc pawc commented Oct 18, 2015

No description provided.

@@ -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;
Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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

@paddatrapper
Copy link
Owner

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{
Copy link
Owner

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

@paddatrapper paddatrapper merged commit 8a02d52 into paddatrapper:master Oct 18, 2015
@paddatrapper
Copy link
Owner

Merged

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants