1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 *9 * http://www.apache.org/licenses/LICENSE-2.010 *11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */17packageorg.apache.jetspeed.security.impl;
1819import java.util.prefs.Preferences;
2021import org.apache.jetspeed.security.HierarchyResolver;
22import org.apache.jetspeed.util.ArgUtil;
2324/***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] than33 * </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:5844 * dlestrat Exp $45 */46publicclassAggregationHierarchyResolverextendsBaseHierarchyResolver implements HierarchyResolver
47 {
48/***49 * @see org.apache.jetspeed.security.HierarchyResolver#resolve(Preferences)50 */51public String[] resolve(Preferences prefs)
52 {
53 ArgUtil.notNull(new Object[] { prefs }, new String[] { "preferences" }, "resolve(java.util.prefs.Preferences)");
5455return resolveChildren(prefs);
56 }
5758 }