2015-05-18 19:15:11 +02:00
|
|
|
package org.gcube.common.authorization.library;
|
|
|
|
|
2015-06-04 18:50:06 +02:00
|
|
|
import java.util.ArrayList;
|
2015-05-29 18:32:49 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2015-05-18 19:15:11 +02:00
|
|
|
import javax.xml.bind.annotation.XmlAccessType;
|
|
|
|
import javax.xml.bind.annotation.XmlAccessorType;
|
|
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
|
|
|
|
@XmlRootElement
|
|
|
|
@XmlAccessorType(XmlAccessType.FIELD)
|
|
|
|
public class AuthorizationEntry {
|
|
|
|
|
|
|
|
private String userName;
|
2015-05-29 18:32:49 +02:00
|
|
|
private List<String> roles;
|
2015-05-18 19:15:11 +02:00
|
|
|
private String scope;
|
2015-07-21 12:39:27 +02:00
|
|
|
private List<BannedService> bannedServices = new ArrayList<BannedService>();
|
2015-05-18 19:15:11 +02:00
|
|
|
|
|
|
|
protected AuthorizationEntry(){}
|
|
|
|
|
2015-05-29 18:32:49 +02:00
|
|
|
public AuthorizationEntry(String userName, List<String> roles, String scope) {
|
2015-05-18 19:15:11 +02:00
|
|
|
super();
|
|
|
|
this.userName = userName;
|
2015-05-29 18:32:49 +02:00
|
|
|
this.roles = roles;
|
2015-05-18 19:15:11 +02:00
|
|
|
this.scope = scope;
|
|
|
|
}
|
2015-06-04 18:50:06 +02:00
|
|
|
|
2015-07-21 12:39:27 +02:00
|
|
|
public AuthorizationEntry(String userName, List<String> roles, String scope, List<BannedService> bannedServices) {
|
2015-06-04 18:50:06 +02:00
|
|
|
this(userName, roles, scope);
|
|
|
|
this.bannedServices = bannedServices;
|
|
|
|
}
|
2015-05-18 19:15:11 +02:00
|
|
|
|
|
|
|
public String getUserName() {
|
|
|
|
return userName;
|
|
|
|
}
|
|
|
|
|
2015-05-29 18:32:49 +02:00
|
|
|
public List<String> getRoles() {
|
|
|
|
return roles;
|
2015-05-18 19:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getScope() {
|
|
|
|
return scope;
|
|
|
|
}
|
2015-06-04 18:50:06 +02:00
|
|
|
|
2015-07-21 12:39:27 +02:00
|
|
|
public List<BannedService> getBannedServices() {
|
2015-06-04 18:50:06 +02:00
|
|
|
return bannedServices;
|
|
|
|
}
|
|
|
|
|
2015-07-21 12:39:27 +02:00
|
|
|
public void setBannedServices(List<BannedService> bannedServices) {
|
2015-06-04 18:50:06 +02:00
|
|
|
this.bannedServices = bannedServices;
|
|
|
|
}
|
2015-05-18 19:15:11 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
2015-05-29 18:32:49 +02:00
|
|
|
return "AuthorizationEntry [userName=" + userName + ", roles=" + roles
|
2015-07-21 12:39:27 +02:00
|
|
|
+ ", scope=" + scope + " bannedServices "+ bannedServices+"]";
|
2015-05-18 19:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|