1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.security;
1819// Jetspeed imports20import org.apache.jetspeed.om.security.JetspeedUser;
21import org.apache.jetspeed.om.profile.Entry;
22import org.apache.jetspeed.portal.Portlet;
23import org.apache.jetspeed.services.security.PortalResource;
2425// Turbine imports26import org.apache.turbine.services.Service;
2728/***29 * <p> The <code>PortalAccessController</code> interface defines a contract between 30 * the portal and security provider required for authorization to portal-secure areas.31 * This interface enables an application to be independent of the underlying 32 * authorization technology.33 *34 * 35 * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>36 * @version $Id: PortalAccessController.java,v 1.4 2004/02/23 03:58:11 jford Exp $37 */3839publicinterfacePortalAccessControllerextends Service
40 {
41public String SERVICE_NAME = "PortalAccessController";
4243/*** Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on44 * the given Portlet Instance (<code>Entry</code>) resource. If the user does not have45 * sufficient privilege to perform the action on the resource, the check returns false,46 * otherwise when sufficient privilege is present, checkPermission returns true.47 *48 * @param user the user to be checked.49 * @param entry the portlet instance resource.50 * @param action the secured action to be performed on the resource by the user.51 * @return boolean true if the user has sufficient privilege.52 * @depracated Use checkpermission(user, entry, action, owner)53 */54publicboolean checkPermission(JetspeedUser user, Entry entry, String action);
5556/***57 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on58 * the given Portlet Instance (<code>Entry</code>) resource. If the user does not have59 * sufficient privilege to perform the action on the resource, the check returns false,60 * otherwise when sufficient privilege is present, checkPermission returns true.61 *62 * @param user the user to be checked.63 * @param entry the portlet instance resource.64 * @param action the secured action to be performed on the resource by the user.65 * @param owner of the entry, i.e. the username66 * @return boolean true if the user has sufficient privilege.67 */68publicboolean checkPermission(JetspeedUser user, Entry entry, String action, String owner);
6970/***71 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on72 * the given <code>Portlet</code> resource. If the user does not have73 * sufficient privilege to perform the action on the resource, the check returns false,74 * otherwise when sufficient privilege is present, checkPermission returns true.75 *76 * @param user the user to be checked.77 * @param portlet the portlet resource.78 * @param action the secured action to be performed on the resource by the user.79 * @return boolean true if the user has sufficient privilege.80 *81 * @depracated Use checkpermission(user, portlet, action, owner)82 */83publicboolean checkPermission(JetspeedUser user, Portlet portlet, String action);
8485/***86 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on87 * the given <code>Portlet</code> resource. If the user does not have88 * sufficient privilege to perform the action on the resource, the check returns false,89 * otherwise when sufficient privilege is present, checkPermission returns true.90 *91 * @param user the user to be checked.92 * @param portlet the portlet resource.93 * @param action the secured action to be performed on the resource by the user.94 * @param owner of the portlet, i.e. the username95 * @return boolean true if the user has sufficient privilege.96 */97publicboolean checkPermission(JetspeedUser user, Portlet portlet, String action, String owner);
9899/***100 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on101 * the given resource. If the user does not have102 * sufficient privilege to perform the action on the resource, the check returns false,103 * otherwise when sufficient privilege is present, checkPermission returns true.104 *105 * @param user the user to be checked.106 * @param resource requesting an action107 * @param action the secured action to be performed on the resource by the user.108 * @return boolean true if the user has sufficient privilege.109 */110publicboolean checkPermission(JetspeedUser user, PortalResource resource, String action);
111 }
112113114