Search in sources :

Example 36 with DelegationConfig

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();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 37 with DelegationConfig

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();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 38 with DelegationConfig

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();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 39 with DelegationConfig

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));
    }
}
Also used : ServiceSchema(com.sun.identity.sm.ServiceSchema) Set(java.util.Set) HashSet(java.util.HashSet) SMSException(com.sun.identity.sm.SMSException) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) PropertyXMLBuilder(com.sun.identity.console.property.PropertyXMLBuilder) HashSet(java.util.HashSet)

Example 40 with DelegationConfig

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));
    }
}
Also used : ServiceSchema(com.sun.identity.sm.ServiceSchema) SMSException(com.sun.identity.sm.SMSException) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) PropertyXMLBuilder(com.sun.identity.console.property.PropertyXMLBuilder)

Aggregations

DelegationConfig (com.sun.identity.console.delegation.model.DelegationConfig)43 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)32 SSOException (com.iplanet.sso.SSOException)8 SMSException (com.sun.identity.sm.SMSException)8 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)7 PropertyXMLBuilder (com.sun.identity.console.property.PropertyXMLBuilder)4 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)4 InputStream (java.io.InputStream)4 ServiceSchema (com.sun.identity.sm.ServiceSchema)3 Set (java.util.Set)3 HashSet (java.util.HashSet)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 SAMLPropertyXMLBuilder (com.sun.identity.console.federation.SAMLPropertyXMLBuilder)1 EndUserViewBean (com.sun.identity.console.idm.EndUserViewBean)1 SubConfigPropertyXMLBuilder (com.sun.identity.console.property.SubConfigPropertyXMLBuilder)1 IdRepoException (com.sun.identity.idm.IdRepoException)1 ServiceSchemaManager (com.sun.identity.sm.ServiceSchemaManager)1 List (java.util.List)1