Search in sources :

Example 1 with AccessControlModelImpl

use of com.sun.identity.console.base.model.AccessControlModelImpl in project OpenAM by OpenRock.

the class AMViewConfig method getTabsModel.

public CCTabsModel getTabsModel(String type, String realmName, HttpServletRequest req) {
    CCTabsModel tabModel = new CCTabsModel();
    AccessControlModel model = new AccessControlModelImpl(req);
    List tabs = getTabList(type);
    if ((tabs == null) || tabs.isEmpty()) {
        return null;
    }
    for (Iterator iter = tabs.iterator(); iter.hasNext(); ) {
        AMTabEntry entry = (AMTabEntry) iter.next();
        CCNavNode navNode = entry.getNavNode(model, realmName);
        if (navNode != null) {
            tabModel.addNode(navNode);
        }
    }
    return tabModel;
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) AccessControlModel(com.sun.identity.console.base.model.AccessControlModel) AccessControlModelImpl(com.sun.identity.console.base.model.AccessControlModelImpl) CCNavNode(com.sun.web.ui.model.CCNavNode) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List)

Example 2 with AccessControlModelImpl

use of com.sun.identity.console.base.model.AccessControlModelImpl in project OpenAM by OpenRock.

the class AMViewConfig method getDefaultViewBeanURL.

public String getDefaultViewBeanURL(String type, String realmName, HttpServletRequest req) {
    AccessControlModel model = new AccessControlModelImpl(req);
    List list = getTabList(type);
    String url = null;
    for (Iterator i = list.iterator(); i.hasNext() && (url == null); ) {
        AMTabEntry entry = (AMTabEntry) i.next();
        url = entry.getURL(model, realmName);
    }
    return url;
}
Also used : AccessControlModel(com.sun.identity.console.base.model.AccessControlModel) AccessControlModelImpl(com.sun.identity.console.base.model.AccessControlModelImpl) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List)

Example 3 with AccessControlModelImpl

use of com.sun.identity.console.base.model.AccessControlModelImpl in project OpenAM by OpenRock.

the class AMViewConfig method getSAMLv2TabsModel.

// all tabs for SAMLv2 property page are predefined in fmConsoleConfiguration.xml.
//here unwanted tabs are hidden based on the role of the respective entity.
public CCTabsModel getSAMLv2TabsModel(String type, String realmName, HttpServletRequest req, List tabsToDisplay) {
    CCTabsModel tabModel = new CCTabsModel();
    AccessControlModel model = new AccessControlModelImpl(req);
    List tabs = getTabList(type);
    if ((tabs == null) || tabs.isEmpty()) {
        return null;
    }
    for (Iterator iter = tabs.iterator(); iter.hasNext(); ) {
        AMTabEntry entry = (AMTabEntry) iter.next();
        for (Iterator tab_iter = tabsToDisplay.iterator(); tab_iter.hasNext(); ) {
            String roletoDisplay = (String) tab_iter.next();
            if (entry.getViewBean().contains(roletoDisplay)) {
                CCNavNode navNode = entry.getNavNode(model, realmName);
                if (navNode != null) {
                    tabModel.addNode(navNode);
                }
            }
        }
    }
    return tabModel;
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) AccessControlModel(com.sun.identity.console.base.model.AccessControlModel) AccessControlModelImpl(com.sun.identity.console.base.model.AccessControlModelImpl) CCNavNode(com.sun.web.ui.model.CCNavNode) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List)

Example 4 with AccessControlModelImpl

use of com.sun.identity.console.base.model.AccessControlModelImpl in project OpenAM by OpenRock.

the class AMViewConfig method getTabViewBeanClass.

private Class getTabViewBeanClass(AMViewBeanBase vb, String realmName, AMModel model, String type, int idx, int childIdx) throws AMConsoleException {
    List list = getTabList(type);
    Class clazz = null;
    AccessControlModel accessModel = new AccessControlModelImpl(model.getUserSSOToken());
    for (Iterator i = list.iterator(); i.hasNext() && (clazz == null); ) {
        AMTabEntry entry = (AMTabEntry) i.next();
        if (entry.canView(accessModel, realmName)) {
            if (idx == -1) {
                clazz = entry.getTabClass();
            } else {
                clazz = entry.getTabClass(idx);
            }
            if (clazz == null) {
                clazz = getEntityTypeClass(vb, idx, realmName, model);
                if (clazz == null) {
                    clazz = getAgentTypeClass(vb, idx, model);
                }
            } else if (BlankTabViewBean.class.equals(clazz)) {
                switch(childIdx) {
                    case -1:
                        clazz = null;
                        break;
                    default:
                        clazz = getTabViewBeanClass(vb, realmName, model, type, childIdx, -1);
                        break;
                }
            }
        }
    }
    if (clazz == null) {
        throw new AMConsoleException("AMViewConfig.getTabClass: no action class for node ID, " + idx);
    }
    return clazz;
}
Also used : AccessControlModel(com.sun.identity.console.base.model.AccessControlModel) AccessControlModelImpl(com.sun.identity.console.base.model.AccessControlModelImpl) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 5 with AccessControlModelImpl

use of com.sun.identity.console.base.model.AccessControlModelImpl in project OpenAM by OpenRock.

the class AMViewConfig method getSupportedEntityTypesMap.

public Map getSupportedEntityTypesMap(String realmName, AMModel model) {
    Map supported = null;
    AccessControlModel accessModel = new AccessControlModelImpl(model.getUserSSOToken());
    Set permission = new HashSet(2);
    permission.add(AMAdminConstants.IDREPO_SERVICE_NAME);
    if (accessModel.canView(permission, null, realmName, false)) {
        supported = model.getSupportedEntityTypes(realmName);
    }
    return (supported == null) ? Collections.EMPTY_MAP : supported;
}
Also used : AccessControlModel(com.sun.identity.console.base.model.AccessControlModel) AccessControlModelImpl(com.sun.identity.console.base.model.AccessControlModelImpl) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) Map(java.util.Map) NamedNodeMap(org.w3c.dom.NamedNodeMap) HashSet(java.util.HashSet)

Aggregations

AccessControlModel (com.sun.identity.console.base.model.AccessControlModel)6 AccessControlModelImpl (com.sun.identity.console.base.model.AccessControlModelImpl)6 OptionList (com.iplanet.jato.view.html.OptionList)5 ArrayList (java.util.ArrayList)5 Iterator (java.util.Iterator)5 List (java.util.List)5 NodeList (org.w3c.dom.NodeList)5 CCNavNode (com.sun.web.ui.model.CCNavNode)2 CCTabsModel (com.sun.web.ui.model.CCTabsModel)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 NamedNodeMap (org.w3c.dom.NamedNodeMap)1