|
@@ -118,8 +118,12 @@ public class SimpleAuthenticationBuilder implements AuthenticationBuilder {
|
|
public AuthenticationBuilder json(String json) {
|
|
public AuthenticationBuilder json(String json) {
|
|
JSONObject jsonObject = JSON.parseObject(json);
|
|
JSONObject jsonObject = JSON.parseObject(json);
|
|
user(jsonObject.getObject("user", SimpleUser.class));
|
|
user(jsonObject.getObject("user", SimpleUser.class));
|
|
- role(jsonObject.getJSONArray("roles").toJSONString());
|
|
|
|
- permission(jsonObject.getJSONArray("permissions").toJSONString());
|
|
|
|
|
|
+ if(jsonObject.containsKey("roles")){
|
|
|
|
+ role(jsonObject.getJSONArray("roles").toJSONString());
|
|
|
|
+ }
|
|
|
|
+ if(jsonObject.containsKey("permissions")){
|
|
|
|
+ permission(jsonObject.getJSONArray("permissions").toJSONString());
|
|
|
|
+ }
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|