Package org.geoserver.gwc.web.diskquota

Source Code of org.geoserver.gwc.web.diskquota.DiskQuotaWarningProvider

package org.geoserver.gwc.web.diskquota;

import org.apache.wicket.Component;
import org.geoserver.security.GeoServerSecurityManager;
import org.geoserver.web.GeoServerApplication;
import org.geoserver.web.GeoServerHomePageContentProvider;

/**
* Adds a error message to the home page in case the current user is the administrator
* and the disk quota store failed to load
*
* @author Andrea Aime - GeoSolutions
*/
public class DiskQuotaWarningProvider implements GeoServerHomePageContentProvider {

    @Override
    public Component getPageBodyComponent(String id) {
        GeoServerSecurityManager secMgr = GeoServerApplication.get().getSecurityManager();
        if (secMgr.checkAuthenticationForAdminRole() && DiskQuotaWarningPanel.getException() != null) {
            return new DiskQuotaWarningPanel(id);
        } else {
            return null;
        }
    }

}
TOP

Related Classes of org.geoserver.gwc.web.diskquota.DiskQuotaWarningProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.