75 lines
1.6 KiB
Java
75 lines
1.6 KiB
Java
package org.gcube.common.authorization.library;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import javax.xml.bind.annotation.XmlAccessType;
|
|
import javax.xml.bind.annotation.XmlAccessorType;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
import org.gcube.common.scope.api.ServiceMap;
|
|
|
|
@XmlRootElement
|
|
@XmlAccessorType(XmlAccessType.FIELD)
|
|
public class AuthorizationEntry {
|
|
|
|
private String clientId;
|
|
private List<String> roles;
|
|
private String context;
|
|
private ServiceMap map;
|
|
private List<CalledService> bannedServices = new ArrayList<CalledService>();
|
|
|
|
protected AuthorizationEntry(){}
|
|
|
|
public AuthorizationEntry(String clientId, List<String> roles, String context) {
|
|
super();
|
|
this.clientId = clientId;
|
|
this.roles = roles;
|
|
this.context = context;
|
|
}
|
|
|
|
public AuthorizationEntry(String userName, List<String> roles, String context , List<CalledService> bannedServices) {
|
|
this(userName, roles, context);
|
|
this.bannedServices = bannedServices;
|
|
}
|
|
|
|
public String getClientId() {
|
|
return clientId;
|
|
}
|
|
|
|
public List<String> getRoles() {
|
|
return roles;
|
|
}
|
|
|
|
public String getContext() {
|
|
return context;
|
|
}
|
|
|
|
public ServiceMap getMap() {
|
|
return map;
|
|
}
|
|
|
|
|
|
|
|
public void setMap(ServiceMap map) {
|
|
this.map = map;
|
|
}
|
|
|
|
public List<CalledService> getBannedServices() {
|
|
return bannedServices;
|
|
}
|
|
|
|
public void setBannedServices(List<CalledService> bannedServices) {
|
|
this.bannedServices = bannedServices;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "AuthorizationEntry [clientId=" + clientId + ", roles=" + roles
|
|
+ ", context=" + context + " bannedServices "+ bannedServices+"]";
|
|
}
|
|
|
|
|
|
|
|
}
|