com.payneteasy.superfly.security.mapbuilder.CollectingActionsSource 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
The newest version!
package com.payneteasy.superfly.security.mapbuilder;
import java.util.List;
import org.springframework.beans.factory.annotation.Required;
import com.payneteasy.superfly.api.ActionDescription;
import com.payneteasy.superfly.api.SSOAction;
import com.payneteasy.superfly.client.ActionDescriptionCollector;
/**
* Obtains actions from {@link ActionDescriptionCollector}.
*
* @author Roman Puchkovskiy
*/
public class CollectingActionsSource implements ActionsSource {
private ActionDescriptionCollector actionDescriptionCollector;
@Required
public void setActionDescriptionCollector(
ActionDescriptionCollector actionDescriptionCollector) {
this.actionDescriptionCollector = actionDescriptionCollector;
}
public SSOAction[] getActions() throws Exception {
List descriptions = actionDescriptionCollector.collect();
SSOAction[] actions = new SSOAction[descriptions.size()];
for (int i = 0; i < descriptions.size(); i++) {
actions[i] = new SSOAction(descriptions.get(i).getName(), false);
}
return actions;
}
}