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.security.permission;
016    
017    import com.liferay.portal.kernel.security.permission.PortletResourceActionsBag;
018    
019    import java.util.HashMap;
020    import java.util.HashSet;
021    import java.util.Map;
022    import java.util.Set;
023    
024    /**
025     * @author L??szl?? Csontos
026     */
027    public class PortletResourceActionsBagImpl
028            extends ResourceActionsBagImpl implements PortletResourceActionsBag {
029    
030            public PortletResourceActionsBagImpl() {
031            }
032    
033            public PortletResourceActionsBagImpl(
034                    PortletResourceActionsBag portletResourceActionsBag) {
035    
036                    super(portletResourceActionsBag);
037    
038                    _portletRootModelResources.putAll(
039                            portletResourceActionsBag.getPortletRootModelResources());
040                    _resourceLayoutManagerActions.addAll(
041                            portletResourceActionsBag.getResourceLayoutManagerActions());
042            }
043    
044            @Override
045            public PortletResourceActionsBag clone() {
046                    return new PortletResourceActionsBagImpl(this);
047            }
048    
049            @Override
050            public Map<String, String> getPortletRootModelResources() {
051                    return _portletRootModelResources;
052            }
053    
054            @Override
055            public Set<String> getResourceLayoutManagerActions() {
056                    return _resourceLayoutManagerActions;
057            }
058    
059            private final Map<String, String> _portletRootModelResources =
060                    new HashMap<>();
061            private final Set<String> _resourceLayoutManagerActions = new HashSet<>();
062    
063    }