1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.security.impl;
18
19 import java.util.prefs.Preferences;
20
21 import org.apache.jetspeed.security.HierarchyResolver;
22 import org.apache.jetspeed.util.ArgUtil;
23
24 /***
25 * <p>
26 * Implementation for "part of" hierarchy. For Example: There're roles:
27 * <ul>
28 * <li>roleA</li>
29 * <li>roleA.roleB</li>
30 * <li>roleA.roleB.roleC</li>
31 * </ul>
32 * if a user has the role [roleA] than
33 * </p>
34 * <code>user.getSubject().getPrincipals()</code> returns:
35 * <ul>
36 * <li>/role/roleA</li>
37 * <li>/role/roleA/roleB</li>
38 * <li>/role/roleA/roleB/roleC</li>
39 * </ul>
40 * </p>
41 *
42 * @author <a href="mailto:Artem.Grinshtein@t-systems.com">Artem Grinshtein </a>
43 * @version $Id: AggregationHierarchyResolver.java,v 1.2 2004/09/18 19:33:58
44 * dlestrat Exp $
45 */
46 public class AggregationHierarchyResolver extends BaseHierarchyResolver implements HierarchyResolver
47 {
48 /***
49 * @see org.apache.jetspeed.security.HierarchyResolver#resolve(Preferences)
50 */
51 public String[] resolve(Preferences prefs)
52 {
53 ArgUtil.notNull(new Object[] { prefs }, new String[] { "preferences" }, "resolve(java.util.prefs.Preferences)");
54
55 return resolveChildren(prefs);
56 }
57
58 }