com.payneteasy.superfly.security.spring.internal.SecurityContext Maven / Gradle / Ivy
package com.payneteasy.superfly.security.spring.internal;
import java.io.Serializable;
import java.util.Set;
public class SecurityContext implements Serializable {
private final String username;
private final Set actions;
public SecurityContext(String aUsername, Set aActions) {
username = aUsername;
actions = aActions;
}
public boolean hasSecureAction(String aSecureAction) {
return actions.contains(aSecureAction);
}
public String getUsername() {
return username;
}
public Set getActions() {
return actions;
}
@Override
public String toString() {
return "SecurityContext{" +
"username='" + username + '\'' +
", actions=" + actions +
'}';
}
}