1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.common;
18
19
20 /***
21 * <p>
22 * SecuredResource
23 * </p>
24 * <p>
25 * Implemented by those resources that have a security constraint defined for
26 * security purposes.
27 *
28 * </p>
29 * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
30 * @version $Id: SecuredResource.java 516448 2007-03-09 16:25:47Z ate $
31 *
32 */
33 public interface SecuredResource
34 {
35
36 /***
37 * <p>
38 * getConstraintsEnabled
39 * </p>
40 *
41 * @return enabled indicator
42 */
43 boolean getConstraintsEnabled();
44
45 /***
46 * <p>
47 * getSecurityConstraints
48 * </p>
49 *
50 * @return security constraints for resource
51 */
52 SecurityConstraints getSecurityConstraints();
53
54 /***
55 * <p>
56 * newSecurityConstraints
57 * </p>
58 *
59 * @return a newly created SecurityConstraints object for use in SecuredResource
60 */
61 SecurityConstraints newSecurityConstraints();
62
63 /***
64 * <p>
65 * newSecurityConstraint
66 * </p>
67 *
68 * @return a newly created SecurityConstraint object for use in SecuredResource
69 */
70 SecurityConstraint newSecurityConstraint();
71
72 /***
73 * <p>
74 * setSecurityConstraints
75 * </p>
76 *
77 * @param constraints security constraints for resource
78 */
79 void setSecurityConstraints(SecurityConstraints constraints);
80
81 /***
82 * <p>
83 * checkConstraints
84 * </p>
85 *
86 * @param actions list to be checked against in CSV string form
87 * @throws SecurityException
88 */
89 void checkConstraints(String actions) throws SecurityException;
90
91 /***
92 * <p>
93 * getPermissionsEnabled
94 * </p>
95 *
96 * @return enabled indicator
97 */
98 boolean getPermissionsEnabled();
99
100 /***
101 * <p>
102 * checkPermissions
103 * </p>
104 *
105 * @param mask Mask of actions to be checked
106 * @throws SecurityException
107 */
108 void checkPermissions(int mask) throws SecurityException;
109
110 /***
111 * <p>
112 * checkAccess
113 * </p>
114 *
115 * @param actions list to be checked against in CSV string form
116 * @throws SecurityException
117 */
118 void checkAccess(String actions) throws SecurityException;
119 }