View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * 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 and
15   * limitations under the License.
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 }