home *** CD-ROM | disk | FTP | other *** search
- package lotus.notes;
-
- public class AgentSecurityContext {
- private boolean m_restricted;
- private boolean m_file_read;
- private boolean m_file_write;
- private boolean m_net_access;
- private boolean m_class_loader;
- private boolean m_extern_exec;
- private boolean m_native_link;
- private boolean m_system_props;
-
- public AgentSecurityContext(ThreadGroup var1, boolean var2) {
- this.m_restricted = var2;
- if (var2) {
- this.m_file_read = false;
- this.m_file_write = false;
- this.m_net_access = false;
- this.m_class_loader = false;
- this.m_extern_exec = false;
- this.m_native_link = false;
- this.m_system_props = false;
- } else {
- this.m_file_read = true;
- this.m_file_write = true;
- this.m_net_access = true;
- this.m_class_loader = true;
- this.m_extern_exec = true;
- this.m_native_link = true;
- this.m_system_props = true;
- }
-
- try {
- AgentSecurityManager var3 = (AgentSecurityManager)System.getSecurityManager();
- if (var3 != null) {
- var3.newSecurityContext(this, var1);
- } else {
- throw new SecurityException(JavaString.resource.getString("missing_security_manager"));
- }
- } catch (ClassCastException var4) {
- }
- }
-
- public final boolean readAllowed() {
- return this.m_file_read;
- }
-
- public final boolean writeAllowed() {
- return this.m_file_write;
- }
-
- public final boolean netAllowed() {
- return this.m_net_access;
- }
-
- public final boolean classLoaderAllowed() {
- return this.m_class_loader;
- }
-
- public final boolean execAllowed() {
- return this.m_extern_exec;
- }
-
- public final boolean linkAllowed() {
- return this.m_native_link;
- }
-
- public final boolean propAllowed() {
- return this.m_system_props;
- }
- }
-