001package org.apache.fulcrum.security.model.dynamic.entity;
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.util.Set;
023
024import org.apache.fulcrum.security.entity.User;
025import org.apache.fulcrum.security.model.basic.entity.BasicUser;
026
027/**
028 * Represents the "simple" model where permissions are related to roles, roles
029 * are related to groups and groups are related to users, all in many to many
030 * relationships.
031 * 
032 * Users have a set of delegates and delegatee's. If user A has B in their
033 * delegates - B assumes A's groups,roles and permissions If user C has D in
034 * their delegatees - C assumes D's groups,roles and permissions
035 * 
036 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
037 * @version $Id$
038 */
039public interface DynamicUser extends BasicUser
040{
041    /**
042     * Get the set of delegatees for this user
043     * 
044     * @param <T>
045     * @return Returns the delegatees.
046     */
047    public <T extends User> Set<T> getDelegatees();
048
049    /**
050     * Set the delegatees for this user
051     * 
052     * @param delegatees
053     *            The delegatees to set.
054     */
055    public <T extends User> void setDelegatees(Set<T> delegatees);
056
057    /**
058     * Get the set of delegators for this user
059     * 
060     * @param <T>
061     * @return Returns the delegators.
062     */
063    public <T extends User> Set<T> getDelegators();
064
065    /**
066     * Set the delegators for this user
067     * 
068     * @param delegators
069     *            The delegators to set.
070     */
071    public <T extends User> void setDelegators(Set<T> delegators);
072}