64 lines
1.4 KiB
Java
64 lines
1.4 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.authorization.library.provider.Service;
|
|
|
|
@XmlRootElement
|
|
@XmlAccessorType(XmlAccessType.FIELD)
|
|
public class AuthorizationEntry {
|
|
|
|
private String userName;
|
|
private List<String> roles;
|
|
private String scope;
|
|
private List<Service> bannedServices = new ArrayList<Service>();
|
|
|
|
protected AuthorizationEntry(){}
|
|
|
|
public AuthorizationEntry(String userName, List<String> roles, String scope) {
|
|
super();
|
|
this.userName = userName;
|
|
this.roles = roles;
|
|
this.scope = scope;
|
|
}
|
|
|
|
public AuthorizationEntry(String userName, List<String> roles, String scope, List<Service> bannedServices) {
|
|
this(userName, roles, scope);
|
|
this.bannedServices = bannedServices;
|
|
}
|
|
|
|
public String getUserName() {
|
|
return userName;
|
|
}
|
|
|
|
public List<String> getRoles() {
|
|
return roles;
|
|
}
|
|
|
|
public String getScope() {
|
|
return scope;
|
|
}
|
|
|
|
public List<Service> getBannedServices() {
|
|
return bannedServices;
|
|
}
|
|
|
|
public void setBannedServices(List<Service> bannedServices) {
|
|
this.bannedServices = bannedServices;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "AuthorizationEntry [userName=" + userName + ", roles=" + roles
|
|
+ ", scope=" + scope + "]";
|
|
}
|
|
|
|
|
|
|
|
}
|