001    /**
002     * Copyright (c) 2000-2013 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.kernel.security.pacl.permission;
016    
017    /**
018     * @author Raymond Aug??
019     */
020    public class PortalFilePermission {
021    
022            public static void checkCopy(String source, String destination) {
023                    _pacl.checkCopy(source, destination);
024            }
025    
026            public static void checkDelete(String path) {
027                    _pacl.checkDelete(path);
028            }
029    
030            public static void checkMove(String source, String destination) {
031                    _pacl.checkMove(source, destination);
032            }
033    
034            public static void checkRead(String path) {
035                    _pacl.checkRead(path);
036            }
037    
038            public static void checkWrite(String path) {
039                    _pacl.checkWrite(path);
040            }
041    
042            private static PACL _pacl = new NoPACL();
043    
044            private static class NoPACL implements PACL {
045    
046                    @Override
047                    public void checkCopy(String source, String destination) {
048                    }
049    
050                    @Override
051                    public void checkDelete(String path) {
052                    }
053    
054                    @Override
055                    public void checkMove(String source, String destination) {
056                    }
057    
058                    @Override
059                    public void checkRead(String path) {
060                    }
061    
062                    @Override
063                    public void checkWrite(String path) {
064                    }
065    
066            }
067    
068            public static interface PACL {
069    
070                    public void checkCopy(String source, String destination);
071    
072                    public void checkDelete(String path);
073    
074                    public void checkMove(String source, String destination);
075    
076                    public void checkRead(String path);
077    
078                    public void checkWrite(String path);
079    
080            }
081    
082    }