001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model.impl;
016    
017    import com.liferay.portal.model.Layout;
018    import com.liferay.portal.model.Portlet;
019    import com.liferay.portal.security.permission.PermissionChecker;
020    
021    import javax.servlet.http.HttpServletRequest;
022    
023    /**
024     * @author Leonardo Barros
025     */
026    public class ModificationDeniedLayoutTypeAccessPolicyImpl
027            extends DefaultLayoutTypeAccessPolicyImpl {
028    
029            @Override
030            public boolean isAddLayoutAllowed(
031                    PermissionChecker permissionChecker, Layout layout) {
032    
033                    return false;
034            }
035    
036            @Override
037            public boolean isCustomizeLayoutAllowed(
038                    PermissionChecker permissionChecker, Layout layout) {
039    
040                    return false;
041            }
042    
043            @Override
044            public boolean isDeleteLayoutAllowed(
045                    PermissionChecker permissionChecker, Layout layout) {
046    
047                    return false;
048            }
049    
050            @Override
051            public boolean isUpdateLayoutAllowed(
052                    PermissionChecker permissionChecker, Layout layout) {
053    
054                    return false;
055            }
056    
057            @Override
058            public boolean isViewLayoutAllowed(
059                    PermissionChecker permissionChecker, Layout layout) {
060    
061                    return true;
062            }
063    
064            @Override
065            protected boolean hasAccessPermission(
066                    HttpServletRequest request, Layout layout, Portlet portlet) {
067    
068                    return true;
069            }
070    
071            @Override
072            protected boolean isAccessAllowedToLayoutPortlet(
073                    HttpServletRequest request, Layout layout, Portlet portlet) {
074    
075                    return true;
076            }
077    
078    }