Package net.jini.security.policy

Examples of net.jini.security.policy.DynamicPolicyProvider.grant()


    public static void main(String[] args) throws Exception {
  if (System.getSecurityManager() == null) {
      System.setSecurityManager(new SecurityManager());
  }
  DynamicPolicyProvider policy = new DynamicPolicyProvider();
  policy.grant(null, null, null);
  try {
      policy.grant(null, new Principal[]{ null }, null);
      throw new Error();
  } catch (NullPointerException e) {
  }
View Full Code Here


      System.setSecurityManager(new SecurityManager());
  }
  DynamicPolicyProvider policy = new DynamicPolicyProvider();
  policy.grant(null, null, null);
  try {
      policy.grant(null, new Principal[]{ null }, null);
      throw new Error();
  } catch (NullPointerException e) {
  }
  try {
      policy.grant(null, null, new Permission[]{ null });
View Full Code Here

      policy.grant(null, new Principal[]{ null }, null);
      throw new Error();
  } catch (NullPointerException e) {
  }
  try {
      policy.grant(null, null, new Permission[]{ null });
      throw new Error();
  } catch (NullPointerException e) {
  }
  policy.getGrants(null, null);
  try {
View Full Code Here

  sm.checkPermission(new RuntimePermission("A"));
  checkPermissionFail(new RuntimePermission("B"));
  checkPermissionFail(new RuntimePermission("C"));

  try {
      policy.grant(Test.class, null,
       new Permission[]{
           new RuntimePermission("B"),
           new RuntimePermission("C")
       });
      throw new Error("grant of B, C should not succeed");
View Full Code Here

  sm.checkPermission(new RuntimePermission("A"));
  checkPermissionFail(new RuntimePermission("B"));
  checkPermissionFail(new RuntimePermission("C"));
  checkPermissionFail(new RuntimePermission("D"));

  policy.grant(Test.class, null,
         new Permission[]{ new RuntimePermission("B") });
  try {
      policy.grant(Test.class, null,
       new Permission[]{ new RuntimePermission("C") });
      throw new Error("grant of C should not succeed");
View Full Code Here

  checkPermissionFail(new RuntimePermission("D"));

  policy.grant(Test.class, null,
         new Permission[]{ new RuntimePermission("B") });
  try {
      policy.grant(Test.class, null,
       new Permission[]{ new RuntimePermission("C") });
      throw new Error("grant of C should not succeed");
  } catch (SecurityException e) {
  }
View Full Code Here

  sm.checkPermission(new RuntimePermission("B"));
  checkPermissionFail(new RuntimePermission("C"));
  sm.checkPermission(new RuntimePermission("D"));

  try {
      policy.grant(Test.class, null,
       new Permission[]{ new RuntimePermission("A") });
      throw new Error("grant of A should not succeed");
  } catch (SecurityException e) {
  }
  policy.grant(Test.class, null,
View Full Code Here

      policy.grant(Test.class, null,
       new Permission[]{ new RuntimePermission("A") });
      throw new Error("grant of A should not succeed");
  } catch (SecurityException e) {
  }
  policy.grant(Test.class, null,
         new Permission[]{ new RuntimePermission("C") });

  checkPermissionFail(new RuntimePermission("A"));
  sm.checkPermission(new RuntimePermission("B"));
  sm.checkPermission(new RuntimePermission("C"));
View Full Code Here

  if (!(policy1.implies(pd, p) && policy2.implies(pd, p))) {
      throw new Error();
  }

  p = new RuntimePermission("C");
  policy2.grant(cl, null, new Permission[]{ p });
  if (policy1.implies(pd, p) || !policy2.implies(pd, p)) {
      throw new Error();
  }
    }
}
View Full Code Here

    public static void main(String[] args) throws Exception {
  if (System.getSecurityManager() == null) {
      System.setSecurityManager(new SecurityManager());
  }
  DynamicPolicyProvider policy = new DynamicPolicyProvider();
  policy.grant((Class) null,(Principal[]) null, (Permission[]) null);
  try {
      policy.grant((Class) null, new Principal[]{ null }, (Permission[]) null);
      throw new Error();
  } catch (NullPointerException e) {
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.