Search in sources :

Example 11 with DelegationConfig

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

the class RealmDiscoveryDescriptionEditViewBean 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 12 with DelegationConfig

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

the class ResponseProviderOpViewBeanBase method createPropertyModel.

private boolean createPropertyModel() {
    boolean init = false;
    HttpServletRequest req = RequestManager.getRequestContext().getRequest();
    String pType = (String) getPageSessionAttribute(PG_SESSION_PROVIDER_TYPE);
    if ((pType == null) || (pType.trim().length() == 0)) {
        pType = req.getParameter(getName() + "." + RESPONSEPROVIDER_TYPE);
        if ((pType != null) && (pType.trim().length() > 0)) {
            setPageSessionAttribute(PG_SESSION_PROVIDER_TYPE, pType);
        }
    }
    String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    if ((curRealm == null) || (curRealm.trim().length() == 0)) {
        curRealm = req.getParameter(getName() + "." + REALM_NAME);
        if ((curRealm != null) && (curRealm.trim().length() > 0)) {
            setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, curRealm);
        }
    }
    init = (curRealm != null) && (curRealm.trim().length() > 0) && (pType != null) && (pType.trim().length() > 0);
    DelegationConfig dConfig = DelegationConfig.getInstance();
    canModify = dConfig.hasPermission(curRealm, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
    if (init) {
        propertySheetModel = new AMPropertySheetModel(getResponseProviderXML(curRealm, pType, !canModify));
        propertySheetModel.clear();
        if (canModify) {
            addRemoveModel = new CCAddRemoveModel();
            addRemoveModel.setShowMoveUpDownButtons("false");
            addRemoveModel.clear();
            propertySheetModel.setModel(VALUES_MULTIPLE_CHOICE_VALUE, addRemoveModel);
        }
    }
    return init;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 13 with DelegationConfig

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

the class AuthPropertiesViewBean method createPropertyModel.

private void createPropertyModel(String realmName) {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    boolean canModify = dConfig.hasPermission(realmName, null, AMAdminConstants.PERMISSION_MODIFY, getModel(), getClass().getName());
    String xmlFile = (canModify) ? "com/sun/identity/console/propertyRealmAuth.xml" : "com/sun/identity/console/propertyRealmAuth_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 14 with DelegationConfig

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

the class AbstractAuditModel method getPropertySheetXML.

@Override
public String getPropertySheetXML(String realmName, String viewBeanName, String viewBeanClassName) throws AMConsoleException {
    DelegationConfig dc = DelegationConfig.getInstance();
    boolean readOnly = !dc.hasPermission(realmName, serviceName, PERMISSION_MODIFY, this, viewBeanClassName);
    xmlBuilder.setAllAttributeReadOnly(readOnly);
    xmlBuilder.setSupportSubConfig(true);
    xmlBuilder.setViewBeanName(viewBeanName);
    try {
        return xmlBuilder.getXML();
    } catch (SSOException | SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : 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)

Example 15 with DelegationConfig

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

the class SMDiscoveryDescriptionEditViewBean 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)

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