01: /*
02: Copyright (c) 2003 eInnovation Inc. All rights reserved
03:
04: This library is free software; you can redistribute it and/or modify it under the terms
05: of the GNU Lesser General Public License as published by the Free Software Foundation;
06: either version 2.1 of the License, or (at your option) any later version.
07:
08: This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
09: without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: See the GNU Lesser General Public License for more details.
11: */
12:
13: package com.openedit.users;
14:
15: import java.util.Collection;
16: import java.util.Date;
17:
18: /**
19: * This interface represents a group, which may have certain permissions.
20: *
21: * @author Eric Galluzzo
22: */
23: public interface Group extends PropertyContainer {
24: /**
25: * The name of this group.
26: *
27: * @return The group name.
28: */
29: String getName();
30:
31: /**
32: * Retrieve the date/time at which this group was created.
33: *
34: * @return The creation date
35: */
36: Date getCreationDate();
37:
38: /**
39: * Retrieve all the names of permissions that this group grants.
40: *
41: * @return A collection of <code>String</code>s
42: */
43: Collection getPermissions();
44:
45: /**
46: * Add the given permission to this group. If the permission is already part of this group,
47: * this method does nothing.
48: *
49: * @param inPermission The name of the permission to add
50: *
51: * @throws UserManagerException If the permission could not be added
52: */
53: void addPermission(String inPermission) throws UserManagerException;
54:
55: /**
56: * Determine whether this group has the given permission.
57: *
58: * @param inPermission The name of the permission
59: *
60: * @return <code>true</code> if so, <code>false</code> if not
61: */
62: boolean hasPermission(String inPermission);
63:
64: /**
65: * Remove the given permission from this group. If the permission is not part of this group,
66: * this method does nothing.
67: *
68: * @param inPermission The name of the permission to remove
69: *
70: * @throws UserManagerException If the permission could not be removed
71: */
72: void removePermission(String inPermission)
73: throws UserManagerException;
74:
75: public PropertyContainer getPropertyContainer();
76:
77: public long getLastModified();
78:
79: }
|