code: public static void authorize(Subject user, Class<?> protocol) 
    throws AuthorizationException {
      Permission permission = protocolToPermissionMap.get(protocol);
      if (permission == null) {
        permission = new ConnectionPermission(protocol);
        protocolToPermissionMap.put(protocol, permission);
      }
      
      checkPermission(user, permission);
    }
docs: Authorize the user to access the protocol being used.
  
  @param user user accessing the service
  @param protocol service being accessed
  @throws AuthorizationException on authorization failure