Search in sources :

Example 26 with DelegationConfig

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

the class SCPolicyResourceComparatorEditViewBean 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/propertySCPolicyResourceComparator.xml" : "com/sun/identity/console/propertySCPolicyResourceComparator_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 27 with DelegationConfig

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

the class WSAuthNServicesHandlersEditViewBean 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/propertyWSAuthNServicesHandlers.xml" : "com/sun/identity/console/propertyWSAuthNServicesHandlers_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 28 with DelegationConfig

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

the class SMDiscoveryProviderResourceIdMapperEditViewBean 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/propertySMDiscoveryProviderResourceIdMapper.xml" : "com/sun/identity/console/propertySMDiscoveryProviderResourceIdMapper_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 29 with DelegationConfig

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

the class SubSchemaModelImpl method getPropertySheetXML.

/**
     * Returns XML for property sheet XML.
     *
     * @param parentId Sub config parent ID.
     * @param viewBeanName Name of View Bean.
     * @param viewBeanClassName Class Name of View Bean.
     * @return XML for property sheet XML.
     */
public String getPropertySheetXML(String parentId, String viewBeanName, String viewBeanClassName) throws AMConsoleException {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    boolean canModify = dConfig.hasPermission("/", serviceName, AMAdminConstants.PERMISSION_MODIFY, this, viewBeanClassName);
    if (!canModify) {
        xmlBuilder.setAllAttributeReadOnly(true);
    }
    subConfigMeta.setParentId(parentId);
    xmlBuilder.setSupportSubConfig(subConfigMeta.hasGlobalSubSchema());
    xmlBuilder.setViewBeanName(viewBeanName);
    try {
        return xmlBuilder.getXML();
    } catch (SSOException e) {
        throw new AMConsoleException(getErrorString(e));
    } catch (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 30 with DelegationConfig

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

the class AMPrimaryMastHeadViewBean method handleRealmNameInTabSwitch.

protected boolean handleRealmNameInTabSwitch(RequestContext rc) {
    boolean forwarded = false;
    // Need to default realm name if it is not even set at this point.
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_PROFILE);
    if (realmName == null) {
        String startDN = AMModelBase.getStartDN(rc.getRequest());
        setPageSessionAttribute(AMAdminConstants.CURRENT_PROFILE, startDN);
    }
    createTabModel();
    DelegationConfig dConfig = DelegationConfig.getInstance();
    //check to see if class is in the noneeddealwith bean
    if (!dConfig.isUncontrolledViewBean(getClass().getName())) {
        if ((tabModel == null) || (tabModel.getNodeCount() == 0)) {
            EndUserViewBean vb = (EndUserViewBean) getViewBean(EndUserViewBean.class);
            vb.forwardTo(rc);
            forwarded = true;
        }
    }
    return forwarded;
}
Also used : EndUserViewBean(com.sun.identity.console.idm.EndUserViewBean) 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