com.payneteasy.superfly.security.CompoundRoleSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of superfly-spring-security Show documentation
Show all versions of superfly-spring-security Show documentation
Module for Spring Security which enables application to use Superfly authentication/authorization declaratively through Spring Security
package com.payneteasy.superfly.security;
import java.util.ArrayList;
import java.util.List;
import com.payneteasy.superfly.api.SSORole;
import com.payneteasy.superfly.api.SSOUser;
public class CompoundRoleSource implements RoleSource {
private RoleSource[] roleSources;
public CompoundRoleSource(RoleSource[] roleSources) {
this.roleSources = roleSources;
}
public String[] getRoleNames(SSOUser ssoUser, SSORole ssoRole) {
List resultList = new ArrayList();
for (RoleSource roleSource : roleSources) {
String[] actionNames = roleSource.getRoleNames(ssoUser, ssoRole);
for (String actionName : actionNames) {
resultList.add(actionName);
}
}
return resultList.toArray(new String[resultList.size()]);
}
}