1 /* 2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 3 * Copyright (C) 2003-2008 Frederico Caldeira Knabben 4 * 5 * == BEGIN LICENSE == 6 * 7 * Licensed under the terms of any of the following licenses at your 8 * choice: 9 * 10 * - GNU General Public License Version 2 or later (the "GPL") 11 * http://www.gnu.org/licenses/gpl.html 12 * 13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 14 * http://www.gnu.org/licenses/lgpl.html 15 * 16 * - Mozilla Public License Version 1.1 or later (the "MPL") 17 * http://www.mozilla.org/MPL/MPL-1.1.html 18 * 19 * == END LICENSE == 20 */ 21 package net.fckeditor.requestcycle; 22 23 import javax.servlet.http.HttpServletRequest; 24 25 26 /** 27 * Interface that provides the authorization of the following file based user actions: 28 * <ul> 29 * <li>{@link #isEnabledForFileBrowsing(HttpServletRequest)}: Enables the user to browse/select 30 * file.</li> 31 * <li>{@link #isEnabledForFileUpload(HttpServletRequest)}: Enables the user to upload files.</li> 32 * </ul> 33 * 34 * @version $Id: UserAction.java 1913 2008-04-13 16:46:20Z th-schwarz $ 35 */ 36 public interface UserAction { 37 38 /** 39 * Authenticates/enables the current user for uploading file.<br> 40 * If the implementation doesn't bother you, just return <code>true</code>. 41 * 42 * @param request 43 * Servlet request from user 44 * @return <code>true</code> if user can upload to the server else <code>false</code> 45 */ 46 public boolean isEnabledForFileUpload(final HttpServletRequest request); 47 48 /** 49 * Authenticates/enables the current user for browsing files.<br> 50 * If the implementation doesn't bother you, just return <code>true</code>. 51 * 52 * @param request 53 * Servlet request from user 54 * @return <code>true</code> if user can browse the server else <code>false</code> 55 */ 56 public boolean isEnabledForFileBrowsing(final HttpServletRequest request); 57 58 }