/** * Created by IntelliJ IDEA. * @author Felipe Cypriano * * A GrantedAuthority which holds the information of it's parent roles. */ public class AccessGrantedAuthority extends GrantedAuthorityImpl { private Set parentRoles = new HashSet(); public AccessGrantedAuthority(String accessName, Collection parents) { super(accessName); AssertUtils.get().collectionNotEmpty(parents, "Can't exists access without parent."); parentRoles.addAll(parents); } public Set getParentRoles() { return Collections.unmodifiableSet(parentRoles); } @Override public String toString() { return super.toString() + parentRoles; } }