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