001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.om.common;
018:
019: /**
020: * <p>
021: * SecuredResource
022: * </p>
023: * <p>
024: * Implemented by those resources that have a security constraint defined for
025: * security purposes.
026: *
027: * </p>
028: * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
029: * @version $Id: SecuredResource.java 516448 2007-03-09 16:25:47Z ate $
030: *
031: */
032: public interface SecuredResource {
033:
034: /**
035: * <p>
036: * getConstraintsEnabled
037: * </p>
038: *
039: * @return enabled indicator
040: */
041: boolean getConstraintsEnabled();
042:
043: /**
044: * <p>
045: * getSecurityConstraints
046: * </p>
047: *
048: * @return security constraints for resource
049: */
050: SecurityConstraints getSecurityConstraints();
051:
052: /**
053: * <p>
054: * newSecurityConstraints
055: * </p>
056: *
057: * @return a newly created SecurityConstraints object for use in SecuredResource
058: */
059: SecurityConstraints newSecurityConstraints();
060:
061: /**
062: * <p>
063: * newSecurityConstraint
064: * </p>
065: *
066: * @return a newly created SecurityConstraint object for use in SecuredResource
067: */
068: SecurityConstraint newSecurityConstraint();
069:
070: /**
071: * <p>
072: * setSecurityConstraints
073: * </p>
074: *
075: * @param constraints security constraints for resource
076: */
077: void setSecurityConstraints(SecurityConstraints constraints);
078:
079: /**
080: * <p>
081: * checkConstraints
082: * </p>
083: *
084: * @param actions list to be checked against in CSV string form
085: * @throws SecurityException
086: */
087: void checkConstraints(String actions) throws SecurityException;
088:
089: /**
090: * <p>
091: * getPermissionsEnabled
092: * </p>
093: *
094: * @return enabled indicator
095: */
096: boolean getPermissionsEnabled();
097:
098: /**
099: * <p>
100: * checkPermissions
101: * </p>
102: *
103: * @param mask Mask of actions to be checked
104: * @throws SecurityException
105: */
106: void checkPermissions(int mask) throws SecurityException;
107:
108: /**
109: * <p>
110: * checkAccess
111: * </p>
112: *
113: * @param actions list to be checked against in CSV string form
114: * @throws SecurityException
115: */
116: void checkAccess(String actions) throws SecurityException;
117: }
|