2016-01-19 18:49:25 +01:00
|
|
|
package org.gcube.common.authorization.library.policies;
|
|
|
|
|
2016-09-22 10:44:29 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2024-03-12 10:35:57 +01:00
|
|
|
import jakarta.xml.bind.annotation.XmlAccessType;
|
|
|
|
import jakarta.xml.bind.annotation.XmlAccessorType;
|
|
|
|
import jakarta.xml.bind.annotation.XmlRootElement;
|
2016-01-19 18:49:25 +01:00
|
|
|
|
|
|
|
@XmlRootElement
|
|
|
|
@XmlAccessorType(XmlAccessType.FIELD)
|
|
|
|
public class User extends UserEntity {
|
|
|
|
|
|
|
|
protected User() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
2016-02-05 19:14:35 +01:00
|
|
|
protected User(String identifier) {
|
2016-01-19 18:49:25 +01:00
|
|
|
super(identifier);
|
|
|
|
}
|
2016-02-05 19:14:35 +01:00
|
|
|
|
2016-09-22 10:44:29 +02:00
|
|
|
protected User(List<String> excludes) {
|
|
|
|
super(excludes);
|
|
|
|
}
|
|
|
|
|
2016-01-19 18:49:25 +01:00
|
|
|
@Override
|
|
|
|
public UserEntityType getType() {
|
|
|
|
return UserEntityType.USER;
|
|
|
|
}
|
|
|
|
|
2016-02-05 19:14:35 +01:00
|
|
|
@Override
|
|
|
|
public boolean isSubsetOf(UserEntity entity) {
|
|
|
|
if (entity.getType()== UserEntityType.USER)
|
|
|
|
return entity.getIdentifier() ==null || this.getIdentifier().equals(entity.getIdentifier());
|
|
|
|
else return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-01-19 18:49:25 +01:00
|
|
|
}
|