1 /* 2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 3 * Copyright (C) 2004-2009 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 * An interface which provides the authorization of server-side commands.<br /> 28 * The commands are: 29 * <ul> 30 * <li>{@link #isEnabledForFileBrowsing(HttpServletRequest)}: Enables the user 31 * to browse/select files.</li> 32 * <li>{@link #isEnabledForFileUpload(HttpServletRequest)}: Enables the user 33 * to upload files.</li> 34 * </ul> 35 * 36 * @version $Id: UserAction.java 3840 2009-07-08 20:29:46Z mosipov $ 37 */ 38 public interface UserAction { 39 40 /** 41 * Authenticates/enables the current user for uploading files.<br /> 42 * If the implementation doesn't bother you, just return <code>true</code>. 43 * 44 * @param request 45 * Servlet request from user 46 * @return <code>true</code> if user can upload to the server, or 47 * <code>false</code> 48 */ 49 public boolean isEnabledForFileUpload(final HttpServletRequest request); 50 51 /** 52 * Authenticates/enables the current user for browsing files.<br /> 53 * If the implementation doesn't bother you, just return <code>true</code>. 54 * 55 * @param request 56 * Servlet request from user 57 * @return <code>true</code> if user can browse the server, or 58 * <code>false</code> 59 */ 60 public boolean isEnabledForFileBrowsing(final HttpServletRequest request); 61 62 }