Package java.security

Examples of java.security.AllPermission


        if (sm != null)
        {
            ((SecurityManager) sm).checkPermission(
                new AdminPermission(bundle, AdminPermission.EXTENSIONLIFECYCLE));

            if (!((BundleProtectionDomain) bundle.getProtectionDomain()).impliesDirect(new AllPermission()))
            {
                throw new SecurityException("Extension Bundles must have AllPermission");
            }
        }
View Full Code Here


        public void refresh() {
        }

        public PermissionCollection getPermissions(CodeSource codesource) {
          Permissions perms = new Permissions();
          perms.add(new AllPermission());
          return (perms);
        }
      });
    }
   
View Full Code Here

   protected PermissionCollection allPermissions()
   {
      if (all == null)
      {
         all = new Permissions();
         all.add(new AllPermission());
      }
      return all;
   }
View Full Code Here

  public CompositeBundle installCompositeBundle(Map frameworkConfig, String location, Map compositeManifest) throws BundleException {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null)
      // must have AllPermission to do this
      sm.checkPermission(new AllPermission());
    // make a local copy of the manifest first
    compositeManifest = new HashMap(compositeManifest);
    // make sure the manifest is valid
    CompositeHelper.validateCompositeManifest(compositeManifest);
View Full Code Here

            new ArrayList(), new ArrayList());
        assertTrue(pe.isVoid());
        assertNull(pe.getPermissions());

        Collection perms = Arrays.asList(new Permission[] {
            new SecurityPermission("dsfg"), new AllPermission() });
        pe = new PolicyEntry(null, null, perms);
        assertFalse(pe.isVoid());
        assertEquals(perms, new ArrayList(pe.getPermissions()));
    }
View Full Code Here

    Object objToSave = null;
    Object objLoaded = null;

    try {
      objToSave = new java.security.Permissions();
      ((java.security.Permissions) objToSave).add(new AllPermission());
      if (DEBUG)
        System.out.println("Obj = " + objToSave);
      objLoaded = dumpAndReload(objToSave);

      // Has to have worked
View Full Code Here

            /**
             * By default Equinox creates a ProtectionDomain for each bundle with AllPermission permission.
             * That breaks Geronimo security checks. See GERONIMO-5480 for details.
             * This work-around prevents Equinox from adding AllPermission permission to each bundle.
             */
            PermissionCollection emptyPermissionCollection = (new AllPermission()).newPermissionCollection();
            protectionDomain = new ProtectionDomain(null, emptyPermissionCollection);
        }

        BaseClassLoader classLoader;
        if (useURLClassLoader) {
View Full Code Here

        if (sm != null)
        {
            ((SecurityManager) sm).checkPermission(
                new AdminPermission(bundle, AdminPermission.EXTENSIONLIFECYCLE));

            if (!((BundleProtectionDomain) bundle.getProtectionDomain()).impliesDirect(new AllPermission()))
            {
                throw new SecurityException("Extension Bundles must have AllPermission");
            }
        }
View Full Code Here

     * @return
     */
    private static final ProtectionDomain getUnknownProtectionDomain() {
        if (unknownProtectionDomain == null) {
            Permissions permissions = new Permissions();
            permissions.add(new AllPermission());
            unknownProtectionDomain = new ProtectionDomain(null, permissions);
        }
        return unknownProtectionDomain;
    }
View Full Code Here

        }
    }

    private Bundle createMockBundle(Permission... permisions) {
        if (permisions == null || permisions.length == 0) {
            return new SecutiryMockBundle(new AllPermission());
        } else {
            return new SecutiryMockBundle(permisions);
        }
    }
View Full Code Here

TOP

Related Classes of java.security.AllPermission

Copyright © 2018 www.massapicom. 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.