Search in sources :

Example 1 with PublicDataTypeAuthorizationInfo

use of org.entando.entando.aps.system.services.dataobject.helper.PublicDataTypeAuthorizationInfo in project entando-core by entando.

the class DataObjectViewerHelper method getAuthorizationInfo.

@Override
public PublicDataTypeAuthorizationInfo getAuthorizationInfo(String dataobjectId, RequestContext reqCtx) throws ApsSystemException {
    PublicDataTypeAuthorizationInfo authInfo = null;
    try {
        Widget widget = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
        dataobjectId = this.extractDataId(dataobjectId, widget.getConfig(), reqCtx);
        if (null == dataobjectId) {
            _logger.info("Null dataobjectId");
            return null;
        }
        authInfo = this.getDataAuthorizationHelper().getAuthorizationInfo(dataobjectId, true);
        if (null == authInfo) {
            _logger.info("Null authorization info by dataobject '" + dataobjectId + "'");
        }
    } catch (Throwable t) {
        _logger.error("Error extracting dataobject authorization info by dataobject {}", dataobjectId, t);
        throw new ApsSystemException("Error extracting dataobject authorization info by dataobject '" + dataobjectId + "'", t);
    }
    return authInfo;
}
Also used : PublicDataTypeAuthorizationInfo(org.entando.entando.aps.system.services.dataobject.helper.PublicDataTypeAuthorizationInfo) Widget(com.agiletec.aps.system.services.page.Widget) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException)

Aggregations

ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)1 Widget (com.agiletec.aps.system.services.page.Widget)1 PublicDataTypeAuthorizationInfo (org.entando.entando.aps.system.services.dataobject.helper.PublicDataTypeAuthorizationInfo)1