Package java.security

Examples of java.security.ProtectionDomain.implies()


       
        try {
            if (caller != null) {
                ProtectionDomain pd = this.getCallerProtDomain(caller);
                pd.implies(p);
            } else
                AccessController.checkPermission(p);
           
        } catch (SecurityException e) {
           
View Full Code Here


        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Protection domain code src= " + pd.getCodeSource());
        }

        if (!pd.implies(p)) {
           
            if (LOG.isLoggable(Level.FINE)) {
                LOG.fine("permission check failed for " + injectee + ", to get perm " + p + ", for candidate "
                        + candidate);
            }
View Full Code Here

      SecurityManager sm = System.getSecurityManager();
      if (sm != null) {
    ProtectionDomain pd =
        new ProtectionDomain(codeSource, null, this, null);

    if (!pd.implies(downloadPermission)) {
        throw new SecurityException(
      "CodeSource not permitted to define class: " +
      codeSource);
    }
      }
View Full Code Here

        pd = new ProtectionDomain(emptyCS, null, null, prins);
        domains.put(new WeakKey(client, queue), pd);
    }
      }
  }
  boolean ok = pd.implies(permission);
  // XXX what about logging
  if (!ok) {
      throw new AccessControlException("access denied " + permission);
  }
    }
View Full Code Here

      pd = new ProtectionDomain(cs, null, null, null);
       logger.log(Level.FINEST,
          "Checking protection domain: {0}", pd);
     
      // Check if current domain allows desired permission
      if(!pd.implies(perm)) {
          SecurityException se =  new SecurityException(
        "ProtectionDomain " + pd
        + " does not have required permission: " + perm);
                logger.throwing(ActivateWrapper.class.getName(),
              "checkPolicyPermission", se);
View Full Code Here

        pd = new ProtectionDomain(emptyCS, null, null, prins);
        domains.put(new WeakKey(client, queue), pd);
    }
      }
  }
  boolean ok = pd.implies(permission);
  // XXX what about logging
  if (!ok) {
      throw new AccessControlException("access denied " + permission);
  }
    }
View Full Code Here

    synchronized (domains) {
        domains.put(subject, pd);
    }
      }
  }
  if (!pd.implies(permission)) {
      throw new AccessControlException("access denied " + permission);
  }
    }
}
View Full Code Here

      SecurityManager sm = System.getSecurityManager();
      if (sm != null) {
    ProtectionDomain pd =
        new ProtectionDomain(codeSource, null, this, null);

    if (!pd.implies(downloadPermission)) {
        throw new SecurityException(
      "CodeSource not permitted to define class: " +
      codeSource);
    }
      }
View Full Code Here

            }
         );
         if( pd != null )
         {
            MBeanTrustPermission p = new MBeanTrustPermission("register");
            if( pd.implies(p) == false )
            {
               String msg = "MBeanTrustPermission(register) not implied by "
                  + "protection domain of mbean class: "+className+", pd: "+pd;
               throw new SecurityException(msg);
            }
View Full Code Here

/*      */         }
/*      */       });
/* 1400 */       if (pd != null)
/*      */       {
/* 1402 */         MBeanTrustPermission p = new MBeanTrustPermission("register");
/* 1403 */         if (!pd.implies(p))
/*      */         {
/* 1405 */           String msg = "MBeanTrustPermission(register) not implied by protection domain of mbean class: " + className + ", pd: " + pd;
/*      */
/* 1407 */           throw new SecurityException(msg);
/*      */         }
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.