1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services.security;
18
19
20 import org.apache.jetspeed.om.security.JetspeedUser;
21 import org.apache.jetspeed.om.profile.Entry;
22 import org.apache.jetspeed.portal.Portlet;
23 import org.apache.jetspeed.services.security.PortalResource;
24
25
26 import org.apache.turbine.services.Service;
27
28 /***
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 */
38
39 public interface PortalAccessController extends Service
40 {
41 public String SERVICE_NAME = "PortalAccessController";
42
43 /*** Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on
44 * the given Portlet Instance (<code>Entry</code>) resource. If the user does not have
45 * 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 */
54 public boolean checkPermission(JetspeedUser user, Entry entry, String action);
55
56 /***
57 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on
58 * the given Portlet Instance (<code>Entry</code>) resource. If the user does not have
59 * 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 username
66 * @return boolean true if the user has sufficient privilege.
67 */
68 public boolean checkPermission(JetspeedUser user, Entry entry, String action, String owner);
69
70 /***
71 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on
72 * the given <code>Portlet</code> resource. If the user does not have
73 * 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 */
83 public boolean checkPermission(JetspeedUser user, Portlet portlet, String action);
84
85 /***
86 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on
87 * the given <code>Portlet</code> resource. If the user does not have
88 * 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 username
95 * @return boolean true if the user has sufficient privilege.
96 */
97 public boolean checkPermission(JetspeedUser user, Portlet portlet, String action, String owner);
98
99 /***
100 * Given a <code>JetspeedUser</code>, authorize that user to perform the secured action on
101 * the given resource. If the user does not have
102 * 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 action
107 * @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 */
110 public boolean checkPermission(JetspeedUser user, PortalResource resource, String action);
111 }
112
113
114