001package org.apache.fulcrum.security.model.basic; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import java.io.Serializable; 023 024import org.apache.fulcrum.security.acl.AccessControlList; 025import org.apache.fulcrum.security.entity.Group; 026import org.apache.fulcrum.security.util.GroupSet; 027 028/** 029 * This interface describes a control class that makes it easy to find out if a 030 * particular User has a given Permission. It also determines if a User has a a 031 * particular Role. 032 * 033 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a> 034 * @version $Id$ 035 */ 036public interface BasicAccessControlList extends Serializable, AccessControlList 037{ 038 /** 039 * Retrieves all groups for a user 040 * 041 * @return the set of Groups this user has 042 */ 043 GroupSet getGroups(); 044 045 /** 046 * Checks if the user is assigned a specific Group 047 * 048 * @param group 049 * the Group 050 * @return <code>true</code> if the user is assigned to the Group 051 */ 052 boolean hasGroup(Group group); 053 054 /** 055 * Checks if the user is assigned a specific Group 056 * 057 * @param group 058 * the group name 059 * @return <code>true</code>if the user is assigned the Group. 060 */ 061 boolean hasGroup(String group); 062 063}