
net.sf.ahtutils.jsf.util.SecurityActionManager Maven / Gradle / Ivy
package net.sf.ahtutils.jsf.util;
import java.util.Hashtable;
import java.util.Map;
import net.sf.ahtutils.controller.interfaces.UtilsSecurityFacade;
import net.sf.ahtutils.exception.ejb.UtilsNotFoundException;
import net.sf.ahtutils.model.interfaces.idm.UtilsIdentity;
import net.sf.ahtutils.model.interfaces.idm.UtilsUser;
import net.sf.ahtutils.model.interfaces.security.UtilsSecurityAction;
import net.sf.ahtutils.model.interfaces.security.UtilsSecurityCategory;
import net.sf.ahtutils.model.interfaces.security.UtilsSecurityRole;
import net.sf.ahtutils.model.interfaces.security.UtilsSecurityUsecase;
import net.sf.ahtutils.model.interfaces.security.UtilsSecurityView;
import net.sf.ahtutils.model.interfaces.status.UtilsDescription;
import net.sf.ahtutils.model.interfaces.status.UtilsLang;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SecurityActionManager ,
R extends UtilsSecurityRole,
V extends UtilsSecurityView,
U extends UtilsSecurityUsecase,
A extends UtilsSecurityAction,
USER extends UtilsUser>
{
final static Logger logger = LoggerFactory.getLogger(SecurityActionManager.class);
public static ,
R extends UtilsSecurityRole,
V extends UtilsSecurityView,
U extends UtilsSecurityUsecase,
A extends UtilsSecurityAction,
USER extends UtilsUser>
SecurityActionManager
factory(UtilsSecurityFacade fSecurity,final Class cView, String viewId, UtilsIdentity identity) throws UtilsNotFoundException
{
return new SecurityActionManager(fSecurity,cView,viewId,identity);
}
private Map allowed;
public SecurityActionManager(UtilsSecurityFacade fSecurity, final Class cView, String viewId, UtilsIdentity identity) throws UtilsNotFoundException
{
allowed = new Hashtable();
V view = fSecurity.fByCode(cView,viewId);
view = fSecurity.load(cView, view);
for(A a : view.getActions())
{
allowed.put(a.getCode(), identity.hasAction(a.getCode()));
}
}
public Map getAllowed() {return allowed;}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy