home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / Notes.jar / lotus / notes / AgentSecurityContext.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-15  |  1.7 KB  |  72 lines

  1. package lotus.notes;
  2.  
  3. public class AgentSecurityContext {
  4.    private boolean m_restricted;
  5.    private boolean m_file_read;
  6.    private boolean m_file_write;
  7.    private boolean m_net_access;
  8.    private boolean m_class_loader;
  9.    private boolean m_extern_exec;
  10.    private boolean m_native_link;
  11.    private boolean m_system_props;
  12.  
  13.    public AgentSecurityContext(ThreadGroup var1, boolean var2) {
  14.       this.m_restricted = var2;
  15.       if (var2) {
  16.          this.m_file_read = false;
  17.          this.m_file_write = false;
  18.          this.m_net_access = false;
  19.          this.m_class_loader = false;
  20.          this.m_extern_exec = false;
  21.          this.m_native_link = false;
  22.          this.m_system_props = false;
  23.       } else {
  24.          this.m_file_read = true;
  25.          this.m_file_write = true;
  26.          this.m_net_access = true;
  27.          this.m_class_loader = true;
  28.          this.m_extern_exec = true;
  29.          this.m_native_link = true;
  30.          this.m_system_props = true;
  31.       }
  32.  
  33.       try {
  34.          AgentSecurityManager var3 = (AgentSecurityManager)System.getSecurityManager();
  35.          if (var3 != null) {
  36.             var3.newSecurityContext(this, var1);
  37.          } else {
  38.             throw new SecurityException(JavaString.resource.getString("missing_security_manager"));
  39.          }
  40.       } catch (ClassCastException var4) {
  41.       }
  42.    }
  43.  
  44.    public final boolean readAllowed() {
  45.       return this.m_file_read;
  46.    }
  47.  
  48.    public final boolean writeAllowed() {
  49.       return this.m_file_write;
  50.    }
  51.  
  52.    public final boolean netAllowed() {
  53.       return this.m_net_access;
  54.    }
  55.  
  56.    public final boolean classLoaderAllowed() {
  57.       return this.m_class_loader;
  58.    }
  59.  
  60.    public final boolean execAllowed() {
  61.       return this.m_extern_exec;
  62.    }
  63.  
  64.    public final boolean linkAllowed() {
  65.       return this.m_native_link;
  66.    }
  67.  
  68.    public final boolean propAllowed() {
  69.       return this.m_system_props;
  70.    }
  71. }
  72.