com.kero.security.lang.nodes.metaline.PropagationMetaline Maven / Gradle / Ivy
package com.kero.security.lang.nodes.metaline;
import java.util.Map;
import com.kero.security.core.agent.KeroAccessAgent;
import com.kero.security.core.property.Property;
import com.kero.security.core.role.Role;
public class PropagationMetaline extends PropertyMetalineBase {
private Map propagationMap;
public PropagationMetaline(Map propagationMap) {
this.propagationMap = propagationMap;
}
public void interpret(KeroAccessAgent manager, Property property) {
propagationMap.forEach((fromName, toName)-> {
Role from = manager.getOrCreateRole(fromName);
Role to = manager.getOrCreateRole(toName);
property.addRolePropagation(from, to);
});
}
public Map getPropagationMap() {
return this.propagationMap;
}
}