01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.core.security;
19:
20: import java.util.Collection;
21:
22: /**
23: * A <code>User</code> is a {@link ContelligentPrincipal} representing an
24: * individual such as a person and have one ore multiple {@link Role roles}
25: * assigned.
26: *
27: * @see ContelligentPrincipal
28: * @see Role
29: */
30: public interface User extends ContelligentPrincipal {
31: // =========================================================================
32: // from interface Principal:
33: // =========================================================================
34:
35: // String getName(); // Returns the unique id of the role
36: // boolean equals(Object another); // Compares this principal to the
37: // specified object.
38: // int hashCode(); // Returns a hashcode for this principal.
39: // String toString(); // Returns a string representation of this principal.
40:
41: // =========================================================================
42: // inherited from interface ContelligentPrincipal:
43: // =========================================================================
44:
45: // String getDisplayName();
46: // String getGroupId(); // Returns the id of the principal-group tge
47: // principal belongs to.
48:
49: // =========================================================================
50: // additional methods:
51: // =========================================================================
52:
53: /**
54: * Returns the set of roles the user has. If the user hasn't any roles
55: * assigned the set is emtpy. Implementations must guarantee that the set
56: * contains instances implementing interface {@link Role} only.
57: *
58: * @return a <code>Set</code> value
59: */
60: public Collection getRoles();
61:
62: public boolean hasRole(Role role);
63:
64: String getAlias();
65:
66: public boolean isAuthenticated();
67: }
|