1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 *9 * http://www.apache.org/licenses/LICENSE-2.010 *11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */17packageorg.apache.jetspeed.security.impl;
1819import org.apache.jetspeed.security.LoginModuleProxy;
20import org.apache.jetspeed.security.UserManager;
2122/***23 * @see org.apache.jetspeed.security.LoginModuleProxy24 * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>25 */26publicclassLoginModuleProxyImpl implements LoginModuleProxy
27 {
28/*** The {@link LoginModuleProxy}instance. */29static LoginModuleProxy loginModuleProxy;
3031/*** The {@link UserManager}. */32private UserManager userMgr;
3334/*** The portal user role. */35private String portalUserRole;
3637/***38 * <p>39 * Constructor providing a bridge between the login module and the user40 * manager.41 * </p>42 * 43 * @param userMgr The user manager.44 * @param portalUserRole The portal user role shared by all portal users: used45 * in web.xml authorization to detect authenticated portal46 * users.47 * 48 */49publicLoginModuleProxyImpl(UserManager userMgr, String portalUserRole)
50 {
51// The user manager.52this.userMgr = userMgr;
5354// The portal user role55this.portalUserRole = (portalUserRole != null ? portalUserRole : DEFAULT_PORTAL_USER_ROLE_NAME);
5657// Hack providing access to the UserManager in the LoginModule.58// TODO Can we fix this?59 LoginModuleProxyImpl.loginModuleProxy = this;
60 }
61publicLoginModuleProxyImpl(UserManager userMgr)
62 {
63this(userMgr, DEFAULT_PORTAL_USER_ROLE_NAME);
64 }
6566/***67 * @see org.apache.jetspeed.security.LoginModuleProxy#getUserManager()68 */69public UserManager getUserManager()
70 {
71returnthis.userMgr;
72 }
7374/***75 * @see org.apache.jetspeed.security.LoginModuleProxy#getPortalUserRole()76 */77public String getPortalUserRole()
78 {
79returnthis.portalUserRole;
80 }
81 }