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.nosecurity;
1819// Java imports20import javax.servlet.ServletConfig;
2122// Jetspeed import23import org.apache.jetspeed.om.profile.Entry;
24import org.apache.jetspeed.om.security.JetspeedUser;
25import org.apache.jetspeed.portal.Portlet;
26import org.apache.jetspeed.services.security.PortalAccessController;
27import org.apache.jetspeed.services.security.PortalResource;
2829// Turbine imports30import org.apache.turbine.services.TurbineBaseService;
31import org.apache.turbine.services.InitializationException;
3233/***34 * NoSecurityAccessController35 * 36 * Use this service if you want to disable all authorization checks37 *38 * @author <a href="taylor@apache.org">David Sean Taylor</a>39 * @version $Id: NoSecurityAccessController.java,v 1.5 2004/02/23 03:53:24 jford Exp $40 */41publicclassNoSecurityAccessControllerextends TurbineBaseService
42 implements PortalAccessController43 {
4445/***46 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on47 * the given <code>Portlet</code> resource. If the user does not have48 * sufficient privilege to perform the action on the resource, the check returns false,49 * otherwise when sufficient privilege is present, checkPermission returns true.50 *51 * @param user the user to be checked.52 * @param portlet the portlet resource.53 * @param action the secured action to be performed on the resource by the user.54 * @return boolean true if the user has sufficient privilege.55 */56finalpublicboolean checkPermission(JetspeedUser user, Portlet portlet, String action)
57 {
58return checkPermission(user, portlet, action, null);
59 }
6061/***62 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on63 * the given <code>Portlet</code> resource. If the user does not have64 * sufficient privilege to perform the action on the resource, the check returns false,65 * otherwise when sufficient privilege is present, checkPermission returns true.66 *67 * @param user the user to be checked.68 * @param portlet the portlet resource.69 * @param action the secured action to be performed on the resource by the user.70 * @param owner of the entry, i.e. the username71 * @return boolean true if the user has sufficient privilege.72 */73finalpublicboolean checkPermission(JetspeedUser user, Portlet portlet, String action, String owner)
74 {
75returntrue;
76 }
7778/***79 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on80 * the given Portlet Instance (<code>Entry</code>) resource. If the user does not have81 * sufficient privilege to perform the action on the resource, the check returns false,82 * otherwise when sufficient privilege is present, checkPermission returns true.83 *84 * @param user the user to be checked.85 * @param entry the portlet instance resource.86 * @param action the secured action to be performed on the resource by the user.87 * @return boolean true if the user has sufficient privilege.88 */89finalpublicboolean checkPermission(JetspeedUser user, Entry entry, String action)
90 {
91return checkPermission(user, entry, action, null);
92 }
939495/***96 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on97 * the given Portlet Instance (<code>Entry</code>) resource. If the user does not have98 * sufficient privilege to perform the action on the resource, the check returns false,99 * otherwise when sufficient privilege is present, checkPermission returns true.100 *101 * @param user the user to be checked.102 * @param entry the portlet instance resource.103 * @param action the secured action to be performed on the resource by the user.104 * @param owner of the entry, i.e. the username105 * @return boolean true if the user has sufficient privilege.106 */107finalpublicboolean checkPermission(JetspeedUser user, Entry entry, String action, String owner)
108 {
109returntrue;
110 }
111112113/***114 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on115 * the given resource. If the user does not have116 * sufficient privilege to perform the action on the resource, the check returns false,117 * otherwise when sufficient privilege is present, checkPermission returns true.118 *119 * @param user the user to be checked.120 * @param resource requesting an action121 * @param action the secured action to be performed on the resource by the user.122 * @return boolean true if the user has sufficient privilege.123 */124finalpublicboolean checkPermission(JetspeedUser user, PortalResource resource, String action)
125 {
126returntrue;
127 }
128129130131/*132 * Turbine Services Interface133 */134135/***136 * This is the early initialization method called by the137 * Turbine <code>Service</code> framework138 * @param conf The <code>ServletConfig</code>139 * @exception throws a <code>InitializationException</code> if the service140 * fails to initialize141 */142publicsynchronizedvoid init(ServletConfig conf)
143 throws InitializationException
144 {
145if (getInit())
146 {
147return;
148 }
149150super.init(conf);
151152 setInit(true);
153 }
154155 }
156