01: /**********************************************************************************
02: * $URL:https://source.sakaiproject.org/svn/osp/trunk/common/api/src/java/org/theospi/portfolio/security/mgt/OspHttpAccessBase.java $
03: * $Id:OspHttpAccessBase.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.theospi.portfolio.security.mgt;
21:
22: import java.util.Collection;
23:
24: import javax.servlet.http.HttpServletRequest;
25: import javax.servlet.http.HttpServletResponse;
26:
27: import org.sakaiproject.entity.api.EntityAccessOverloadException;
28: import org.sakaiproject.entity.api.EntityCopyrightException;
29: import org.sakaiproject.entity.api.EntityNotDefinedException;
30: import org.sakaiproject.entity.api.EntityPermissionException;
31: import org.sakaiproject.entity.api.Reference;
32: import org.sakaiproject.metaobj.shared.mgt.HttpAccessBase;
33: import org.sakaiproject.metaobj.shared.mgt.ReferenceParser;
34: import org.theospi.portfolio.security.AuthorizationFacade;
35:
36: /**
37: * Created by IntelliJ IDEA.
38: * User: John Ellis
39: * Date: Feb 21, 2006
40: * Time: 12:49:04 PM
41: * To change this template use File | Settings | File Templates.
42: */
43: public abstract class OspHttpAccessBase extends HttpAccessBase {
44:
45: private AuthorizationFacade authzManager;
46:
47: public void handleAccess(HttpServletRequest req,
48: HttpServletResponse res, Reference ref,
49: Collection copyrightAcceptedRefs)
50: throws EntityPermissionException,
51: EntityNotDefinedException, EntityAccessOverloadException,
52: EntityCopyrightException {
53: ReferenceParser parser = new ReferenceParser(
54: ref.getReference(), ref.getEntityProducer());
55: authzManager.pushAuthzGroups(parser.getSiteId());
56:
57: super .handleAccess(req, res, ref, copyrightAcceptedRefs);
58: }
59:
60: public AuthorizationFacade getAuthzManager() {
61: return authzManager;
62: }
63:
64: public void setAuthzManager(AuthorizationFacade authzManager) {
65: this.authzManager = authzManager;
66: }
67: }
|