1 21 package org.jacorb.security.level2; 22 23 import org.omg.PortableInterceptor.*; 24 import org.omg.SecurityLevel2.*; 25 import org.jacorb.util.*; 26 import org.jacorb.orb.portableInterceptor.ServerRequestInfoImpl; 27 import java.util.*; 28 29 38 39 public class ServerAccessDecisionInterceptor 40 extends org.omg.CORBA.LocalObject 41 implements ServerRequestInterceptor 42 { 43 public static final String DEFAULT_NAME = 44 "ServerAccessDecisionInterceptor"; 45 46 private String name = null; 47 48 private AccessDecision access_decision = null; 49 private org.omg.SecurityLevel2.Current current = null; 50 private Hashtable special_operations = null; 51 52 public ServerAccessDecisionInterceptor 53 (org.omg.SecurityLevel2.Current current) 54 { 55 this( current, DEFAULT_NAME ); 56 } 57 58 public ServerAccessDecisionInterceptor 59 (org.omg.SecurityLevel2.Current current, 60 String name ) 61 { 62 this.current = current; 63 this.name = name; 64 65 access_decision = current.access_decision(); 66 67 special_operations = new Hashtable(); 68 special_operations.put("_is_a", ""); 69 special_operations.put("_get_interface", ""); 70 special_operations.put("_non_existent", ""); 71 72 special_operations.put("_get_policy", ""); 73 special_operations.put("_get_domain_managers", ""); 74 special_operations.put("_set_policy_overrides", ""); 75 } 76 77 public String name() 79 { 80 return name; 81 } 82 83 public void destroy() 84 { 85 } 86 87 91 public void receive_request_service_contexts(ServerRequestInfo ri) 92 throws ForwardRequest 93 { 94 } 95 96 public void receive_request(ServerRequestInfo ri) 97 throws ForwardRequest 98 { 99 101 if (special_operations.containsKey(ri.operation())) 102 { 103 return; 105 } 106 else 113 { 114 } 116 117 org.omg.CORBA.Object target = 119 ((ServerRequestInfoImpl) ri).target(); 120 121 if (! access_decision.access_allowed( 122 new Credentials[] { current.received_credentials() }, 123 target, 124 ri.operation(), 125 ri.target_most_derived_interface()) 126 ) 127 { 128 throw new org.omg.CORBA.NO_PERMISSION (); 129 } 130 else 131 { 132 } 134 } 135 136 public void send_reply(ServerRequestInfo ri) 137 { 138 } 139 140 public void send_exception(ServerRequestInfo ri) 141 throws ForwardRequest 142 { 143 } 144 145 public void send_other(ServerRequestInfo ri) 146 throws ForwardRequest 147 { 148 } 149 150 } 152 153 154 155 156 157 | Popular Tags |