1 package org.apache.fulcrum.security.model.basic.entity;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.util.Set;
23
24 import org.apache.fulcrum.security.entity.Group;
25 import org.apache.fulcrum.security.entity.User;
26 import org.apache.fulcrum.security.util.GroupSet;
27
28 /**
29 * Represents the "basic" model where users can be part of multiple groups
30 * directly, with no roles or permissions.
31 *
32 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
33 * @version $Id$
34 */
35 public interface BasicUser extends User
36 {
37 /**
38 * Get the groups this user is part of
39 *
40 * @return a set of groups
41 */
42 public GroupSet getGroups();
43
44 /**
45 * Set the groups this user is part of
46 *
47 * @param groups
48 * the set of groups
49 */
50 public void setGroups(GroupSet groups);
51
52 /**
53 * Remove the group from the list of groups
54 *
55 * @param group
56 * the group to remove
57 */
58 public void removeGroup(Group group);
59
60 /**
61 * Add the group to the list of groups
62 *
63 * @param group
64 * the group to add
65 */
66 public void addGroup(Group group);
67
68 /**
69 * Set the groups this user is part of as a Set
70 *
71 * @param groups
72 * the set of groups
73 */
74 public <T extends Group> void setGroupsAsSet(Set<T> groups);
75
76 /**
77 * Get the groups this user is part of as a Set
78 *
79 * @return a set of groups
80 */
81 public <T extends Group> Set<T> getGroupsAsSet();
82 }