use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.
the class ReferralOpViewBeanBase method createPropertyModel.
protected void createPropertyModel(String realmName) {
DelegationConfig dConfig = DelegationConfig.getInstance();
canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(getPropertyXMLFileName(!canModify)));
propertySheetModel.clear();
}
use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.
the class UMUserDiscoveryDescriptionEditViewBean method createPropertyModel.
protected void createPropertyModel() {
DelegationConfig dConfig = DelegationConfig.getInstance();
boolean canModify = dConfig.hasPermission("/", null, AMAdminConstants.PERMISSION_MODIFY, getRequestContext().getRequest(), getClass().getName());
String xmlFile = (canModify) ? "com/sun/identity/console/propertySMDiscoveryDescription.xml" : "com/sun/identity/console/propertySMDiscoveryDescription_Readonly.xml";
propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(xmlFile));
propertySheetModel.clear();
}
use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.
the class FSSAMLTargetURLsEditViewBean method createPropertyModel.
protected void createPropertyModel() {
DelegationConfig dConfig = DelegationConfig.getInstance();
String startDN = AMModelBase.getStartDN(getRequestContext().getRequest());
boolean canModify = dConfig.hasPermission(startDN, null, AMAdminConstants.PERMISSION_MODIFY, getRequestContext().getRequest(), getClass().getName());
// TBD : add readonly xml back
// "com/sun/identity/console/propertyFSSAMLTargetURLsProfile_Readonly.xml";
String xmlFile = (canModify) ? "com/sun/identity/console/propertyFSSAMLTargetURLsProfile.xml" : "com/sun/identity/console/propertyFSSAMLTargetURLsProfile.xml";
propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(xmlFile));
propertySheetModel.clear();
}
use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.
the class EntitiesModelImpl method getServicePropertySheetXML.
/**
* Returns the XML for property sheet view component.
*
* @param realmName Name of Realm.
* @param serviceName Name of service.
* @param idType type of Identity.
* @param bCreate true if the property sheet is for identity creation.
* @param viewbeanClassName Class Name of View Bean.
* @return the XML for property sheet view component.
* @throws AMConsoleException if XML cannot be created.
*/
public String getServicePropertySheetXML(String realmName, String serviceName, IdType idType, boolean bCreate, String viewbeanClassName) throws AMConsoleException {
setLocationDN(realmName);
DelegationConfig dConfig = DelegationConfig.getInstance();
try {
ServiceSchema serviceSchema = AMAdminUtils.getSchemaSchema(serviceName, idType);
Set set = new HashSet(2);
set.add(serviceSchema.getServiceType());
PropertyXMLBuilder xmlBuilder = new PropertyXMLBuilder(serviceName, set, this);
if (!bCreate) {
boolean canModify = dConfig.hasPermission(realmName, serviceName, AMAdminConstants.PERMISSION_MODIFY, this, viewbeanClassName);
if (!canModify) {
xmlBuilder.setAllAttributeReadOnly(true);
}
}
String xml = xmlBuilder.getXML();
if (idType.equals(IdType.ROLE)) {
String cosPriority = AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/propertyEntitiesCOSPriority.xml"));
if (xml != null) {
xml = PropertyXMLBuilder.appendXMLProperty(xml, cosPriority);
} else {
xml = PropertyXMLBuilder.formPropertySheetXML(cosPriority, true);
}
}
return xml;
} catch (SMSException e) {
throw new AMConsoleException(getErrorString(e));
} catch (SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
}
use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.
the class AbstractAuditModel method getEditEventHandlerPropertyXML.
/**
* Get the JATO XML configuration for generation the UI used to edit event handlers.
*
* @param realmName The current realm.
* @param handlerName The audit event handler name.
* @param viewBeanClassName The view bean class name.
* @return The JATO XML configuration for generation the UI.
* @throws AMConsoleException If an error occurs during the XML creation.
*/
public String getEditEventHandlerPropertyXML(String realmName, String handlerName, String viewBeanClassName) throws AMConsoleException {
DelegationConfig dc = DelegationConfig.getInstance();
boolean readOnly = !dc.hasPermission(realmName, serviceName, PERMISSION_MODIFY, this, viewBeanClassName);
try {
String schemaId = getServiceConfig().getSubConfig(handlerName).getSchemaID();
ServiceSchema handlerSchema = getServiceSchema().getSubSchema(schemaId);
updateHandlerResourceBundle(handlerSchema);
xmlBuilder = new PropertyXMLBuilder(handlerSchema, this, handlerResourceBundle, getSectionsForHandler(schemaId), schemaId + SECTION_FILE_NAME_SUFFIX);
xmlBuilder.setAllAttributeReadOnly(readOnly);
xmlBuilder.setSupportSubConfig(false);
return xmlBuilder.getXML();
} catch (SMSException | SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
}
Aggregations