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,15 +1,30 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
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")
|
||||
|
@ -66,5 +81,23 @@ public class GCubeUser implements User {
|
|||
public String getMiddleName() {
|
||||
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