All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.payneteasy.superfly.security.mapbuilder.CollectingActionsSource Maven / Gradle / Ivy

Go to download

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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy