1
14
15 package com.liferay.portal.kernel.portlet;
16
17 import com.liferay.portal.kernel.servlet.ProtectedPrincipal;
18
19 import java.security.Principal;
20
21 import javax.portlet.ActionRequest;
22 import javax.portlet.filter.ActionRequestWrapper;
23
24
29 public class ProtectedActionRequest extends ActionRequestWrapper {
30
31 public ProtectedActionRequest(
32 ActionRequest actionRequest, String remoteUser) {
33
34 super(actionRequest);
35
36 _remoteUser = remoteUser;
37
38 if (remoteUser != null) {
39 _userPrincipal = new ProtectedPrincipal(remoteUser);
40 }
41 }
42
43 public String getRemoteUser() {
44 if (_remoteUser != null) {
45 return _remoteUser;
46 }
47 else {
48 return super.getRemoteUser();
49 }
50 }
51
52 public Principal getUserPrincipal() {
53 if (_userPrincipal != null) {
54 return _userPrincipal;
55 }
56 else {
57 return super.getUserPrincipal();
58 }
59 }
60
61 private String _remoteUser;
62 private Principal _userPrincipal;
63
64 }