01: /*
02: * Copyright 2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: */
13: package com.pentaho.security.acls.voter;
14:
15: import org.acegisecurity.Authentication;
16: import org.pentaho.core.session.IPentahoSession;
17:
18: import com.pentaho.security.SecurityUtils;
19:
20: /**
21: * Extends the BasicAclVoter, but overrides the getAuthentication() method to
22: * allow anonymous sessions. This is the simplest case to add to other voters.
23: *
24: * @author mbatchel
25: *
26: */
27:
28: public class PentahoAllowAnonymousAclVoter extends PentahoBasicAclVoter {
29:
30: // Allow anonymous users to have possible acls on an entry.
31: public Authentication getAuthentication(IPentahoSession session) {
32: return SecurityUtils.getAuthentication(session, true);
33: }
34:
35: }
|