Fixed additional property error
This commit is contained in:
parent
ceafcdefda
commit
74e83aee69
|
@ -50,11 +50,11 @@ public class SocialService {
|
|||
}
|
||||
|
||||
public static SocialService getSocialService() throws Exception {
|
||||
String contex = SecretManager.instance.get().getContext();
|
||||
SocialService socialService = socialServicePerContext.get(contex);
|
||||
String context = SecretManager.instance.get().getContext();
|
||||
SocialService socialService = socialServicePerContext.get(context);
|
||||
if(socialService == null) {
|
||||
socialService = new SocialService();
|
||||
socialServicePerContext.put(contex, socialService);
|
||||
socialServicePerContext.put(context, socialService);
|
||||
}
|
||||
return socialService;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package org.gcube.common.authorization.utils.user;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
|
@ -10,6 +15,16 @@ import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
|||
*/
|
||||
public class GCubeUser implements User {
|
||||
|
||||
/**
|
||||
* Used to allow to have any additional properties
|
||||
*/
|
||||
@JsonIgnore
|
||||
protected Map<String, Object> additionalProperties;
|
||||
|
||||
public GCubeUser() {
|
||||
this.additionalProperties = new HashMap<>();
|
||||
}
|
||||
|
||||
@JsonProperty("id")
|
||||
protected String username;
|
||||
@JsonProperty("roles")
|
||||
|
@ -67,4 +82,22 @@ public class GCubeUser implements User {
|
|||
return middleName;
|
||||
}
|
||||
|
||||
@JsonAnyGetter
|
||||
public Map<String, Object> getAdditionalProperties() {
|
||||
return additionalProperties;
|
||||
}
|
||||
|
||||
public void setAdditionalProperties(Map<String, Object> additionalProperties) {
|
||||
this.additionalProperties = additionalProperties;
|
||||
}
|
||||
|
||||
public Object getAdditionalProperty(String key) {
|
||||
return additionalProperties.get(key);
|
||||
}
|
||||
|
||||
@JsonAnySetter
|
||||
public void setAdditionalProperty(String key, Object value) {
|
||||
this.additionalProperties.put(key, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue