1 28 29 package com.caucho.security; 30 31 import com.caucho.loader.EnvironmentLocal; 32 33 import java.security.Permission ; 34 35 38 public class AuthorizationManager { 39 private static EnvironmentLocal _localAuthorizationManager = 40 new EnvironmentLocal("caucho.security.manager"); 41 42 45 public static AuthorizationManager getAuthorizationManager() 46 { 47 return (AuthorizationManager) _localAuthorizationManager.get(); 48 } 49 50 53 public static void setAuthorizationManager(AuthorizationManager manager) 54 { 55 _localAuthorizationManager.set(manager); 56 } 57 58 61 public void checkPermission(Permission permission) 62 throws SecurityException 63 { 64 SecurityManager securityManager = System.getSecurityManager(); 65 66 if (securityManager != null) 68 securityManager.checkPermission(permission); 69 } 70 71 public String toString() 72 { 73 return "AuthorizationManager[]"; 74 } 75 } 76 | Popular Tags |