KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > core > security > AccessControllerAuthorizationRealm


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.test.core.security;
10
11 import java.util.Set JavaDoc;
12
13 import org.jboss.portal.core.security.AuthorizationRealm;
14
15 /**
16  * The authorization manager implementation that uses the java access controller
17  * to perform checks.
18  *
19  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
20  * @version $Revision: 1.7 $
21  */

22 public class AccessControllerAuthorizationRealm implements AuthorizationRealm
23 {
24
25 /*
26    private boolean isAuthorized(Principal[] principals, final String[] test, final Level level)
27    {
28       // Create the combiner
29       DomainCombiner combiner = new RoleDomainCombiner(principals);
30
31       // Get the new context
32       AccessControlContext ctx = new AccessControlContext(AccessController.getContext(), combiner);
33
34       try
35       {
36          // Push the context as current
37          AccessController.doPrivileged(new PrivilegedAction()
38          {
39             public Object run()
40             {
41                // Check permission under the new context
42                Permission permission = new PortalPermission(test, level);
43                SecurityManager manager = System.getSecurityManager();
44                manager.checkPermission(permission);
45                return null;
46             }
47          }, ctx);
48          return true;
49       }
50       catch (AccessControlException e)
51       {
52          return false;
53       }
54    }
55 */

56
57    public boolean hasPermission(String JavaDoc domain, String JavaDoc role, String JavaDoc permission)
58    {
59       throw new UnsupportedOperationException JavaDoc();
60    }
61
62    public boolean hasPermission(String JavaDoc domain, Set JavaDoc roles, String JavaDoc permission)
63    {
64       throw new UnsupportedOperationException JavaDoc();
65    }
66
67    public boolean hasPermission(String JavaDoc domain, String JavaDoc role, String JavaDoc[] path, String JavaDoc permission)
68    {
69       throw new UnsupportedOperationException JavaDoc();
70    }
71
72    public boolean hasPermission(String JavaDoc domain, Set JavaDoc roles, String JavaDoc[] path, String JavaDoc permission)
73    {
74       throw new UnsupportedOperationException JavaDoc();
75    }
76
77    public boolean hasPermission(String JavaDoc role, String JavaDoc permission)
78    {
79       throw new UnsupportedOperationException JavaDoc();
80    }
81
82    public boolean hasPermission(Set JavaDoc roles, String JavaDoc permission)
83    {
84       throw new UnsupportedOperationException JavaDoc();
85    }
86
87    public boolean hasPermission(String JavaDoc role, String JavaDoc[] path, String JavaDoc permission)
88    {
89       throw new UnsupportedOperationException JavaDoc();
90    }
91
92    public boolean hasPermission(Set JavaDoc roles, String JavaDoc[] path, String JavaDoc permission)
93    {
94       throw new UnsupportedOperationException JavaDoc();
95    }
96 }
97
Popular Tags