From 521d2a1e5e5ca95efdeed427c6c592f13f01b1dc Mon Sep 17 00:00:00 2001 From: maxcooper Date: Mon, 12 Aug 2002 01:39:11 +0000 Subject: [PATCH] initial version --- .../org/securityfilter/config/AuthConstraint.java | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/share/org/securityfilter/config/AuthConstraint.java diff --git a/src/share/org/securityfilter/config/AuthConstraint.java b/src/share/org/securityfilter/config/AuthConstraint.java new file mode 100644 index 0000000..24fb2eb --- /dev/null +++ b/src/share/org/securityfilter/config/AuthConstraint.java @@ -0,0 +1,97 @@ +/* + * $Header: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/config/AuthConstraint.java,v 1.1 2002/08/12 01:39:11 maxcooper Exp $ + * $Revision: 1.1 $ + * $Date: 2002/08/12 01:39:11 $ + * + * ==================================================================== + * The SecurityFilter Software License, Version 1.1 + * + * (this license is derived and fully compatible with the Apache Software + * License - see http://www.apache.org/LICENSE.txt) + * + * Copyright (c) 2002 SecurityFilter.org. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by + * SecurityFilter.org (http://www.securityfilter.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The name "SecurityFilter" must not be used to endorse or promote + * products derived from this software without prior written permission. + * For written permission, please contact license@securityfilter.org . + * + * 5. Products derived from this software may not be called "SecurityFilter", + * nor may "SecurityFilter" appear in their name, without prior written + * permission of SecurityFilter.org. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + */ + +package org.securityfilter.config; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * AuthConstraint + * + * @author Max Cooper (max@maxcooper.com) + */ +public class AuthConstraint { + private Set roles; + + /** + * Constructor + */ + public AuthConstraint() { + roles = new HashSet(); + } + + /** + * Add a role. + * + * @param role role to add + */ + public void addRole(String role) { + roles.add(role); + } + + /** + * Get the roles collection. + * Returns an empty collection if no roles were present in the config file. + */ + public Collection getRoles() { + return Collections.unmodifiableCollection(roles); + } +} + +// ---------------------------------------------------------------------------- +// EOF \ No newline at end of file -- 2.11.0