Search in sources :

Example 16 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class SMDiscoveryBootstrapRefOffEditViewBean method createPropertyModel.

protected void createPropertyModel() {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    canModify = dConfig.hasPermission("/", null, AMAdminConstants.PERMISSION_MODIFY, getRequestContext().getRequest(), getClass().getName());
    String xmlFile = (canModify) ? "com/sun/identity/console/propertySMDiscoveryBootstrapResOff.xml" : "com/sun/identity/console/propertySMDiscoveryBootstrapResOff_Readonly.xml";
    InputStream is = getClass().getClassLoader().getResourceAsStream(xmlFile);
    String xml = AMAdminUtils.getStringFromInputStream(is);
    propertySheetModel = new AMPropertySheetModel(processPropertiesXML(xml));
    propertySheetModel.clear();
    createSecurityMechIDTable();
}
Also used : InputStream(java.io.InputStream) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 17 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class FSSAMLTrustedPartnersEditViewBean method createPropertyModel.

protected boolean createPropertyModel() {
    List profiles = (List) getPageSessionAttribute(PROFILES);
    if (profiles != null) {
        DelegationConfig dConfig = DelegationConfig.getInstance();
        String startDN = AMModelBase.getStartDN(getRequestContext().getRequest());
        boolean canModify = dConfig.hasPermission(startDN, null, AMAdminConstants.PERMISSION_MODIFY, getRequestContext().getRequest(), getClass().getName());
        SAMLPropertyXMLBuilder builder = SAMLPropertyXMLBuilder.getInstance();
        // TBD : change to set flag to Readonly (true)
        if (!canModify) {
            builder.setAllAttributeReadOnly(false);
        }
        propertySheetModel = new AMPropertySheetModel(builder.getXML(profiles, !isCreateViewBean()));
        propertySheetModel.clear();
        return true;
    }
    return false;
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) List(java.util.List) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig) SAMLPropertyXMLBuilder(com.sun.identity.console.federation.SAMLPropertyXMLBuilder)

Example 18 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class WSPPServiceDSAttributeMapListEditViewBean 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/propertyWSPersonalProfileDSAttributeMapList.xml" : "com/sun/identity/console/propertyWSPersonalProfileDSAttributeMapList_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 19 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class WSPPServiceSupportedContainerEditViewBean 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/propertyWSPersonalProfileSupportedContainers.xml" : "com/sun/identity/console/propertyWSPersonalProfileSupportedContainers_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 20 with DelegationConfig

use of com.sun.identity.console.delegation.model.DelegationConfig in project OpenAM by OpenRock.

the class RMRealmModelImpl method getRealmProfilePropertyXML.

/**
     * Returns realm profile property XML.
     *
     * @param realmName Name of Realm.
     * @param viewbeanClassName Class name of View Bean
     * @throws AMConsoleException if there are no attributes to display.
     * @return realm profile property XML.
     */
public String getRealmProfilePropertyXML(String realmName, String viewbeanClassName) throws AMConsoleException {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    boolean canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, this, viewbeanClassName);
    StringBuffer buff = new StringBuffer(2000);
    buff.append(PropertyXMLBuilderBase.getXMLDefinitionHeader()).append(PropertyTemplate.START_TAG);
    getPropertyXML(buff, !canModify);
    buff.append(PropertyTemplate.END_TAG);
    return buff.toString();
}
Also used : DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

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