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 PermissionManager { 39 private static EnvironmentLocal<PermissionManager> _localPermissionManager = 40 new EnvironmentLocal<PermissionManager>("caucho.security.permission-manager"); 41 42 45 public static PermissionManager getPermissionManager() 46 { 47 return _localPermissionManager.get(); 48 } 49 50 53 public static void setPermissionManager(PermissionManager manager) 54 { 55 _localPermissionManager.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 "PermissionManager[]"; 74 } 75 } 76 | Popular Tags |