Package java.security

Examples of java.security.Permission


    String[] s = new String[n];
    for(int i=0; i<n; i++) {
      s[i] = args[i].toString();
    }
    try {
      Permission p = anvil.server.PolicyPreferences.createPermission(s);
      if (p == null) {
        throw context.BadParameter("Permission");
      }
      return new AnyPermission(p);
    } catch (Throwable t) {
View Full Code Here


  public final void serialize(Serializer serializer) throws IOException
  {
    if (serializer.register(this)) {
      return;
    }
    Permission perm = _permission;
    serializer.write('P');
    serializer.write(perm.getClass().getName());
    serializer.write(perm.getName());
    serializer.write(perm.getActions());
  }
View Full Code Here

            return;
        }

        // the check
        try {
            final Permission sp = new SystemPermission(
                SystemPermission.ENGINE, SystemPermission.SHUTDOWN);
            checkSystemPrivileges(user, sp);
        } catch (AccessControlException ace) {
            throw Util.generateCsSQLException(
        SQLState.AUTH_SHUTDOWN_MISSING_PERMISSION,
View Full Code Here

            }
        }

        Enumeration e = notAssigned.elements();
        while (e.hasMoreElements()) {
            Permission p = (Permission) e.nextElement();
            permissions.add(p);
        }

    }
View Full Code Here

     */
    private Permissions cullPermissions(Permissions toBeChecked, Permission permission) {
        Permissions result = new Permissions();

        for (Enumeration e = toBeChecked.elements(); e.hasMoreElements();) {
            Permission test = (Permission) e.nextElement();
            if (!permission.implies(test)) {
                result.add(test);
            }
        }

View Full Code Here

            }
        }

        Enumeration e = notAssigned.elements();
        while (e.hasMoreElements()) {
            Permission p = (Permission) e.nextElement();
            permissions.add(p);
        }

    }
View Full Code Here

     */
    private Permissions cullPermissions(PermissionCollection toBeChecked, Permission permission) {
        Permissions result = new Permissions();

        for (Enumeration e = toBeChecked.elements(); e.hasMoreElements();) {
            Permission test = (Permission) e.nextElement();
            if (!permission.implies(test)) {
                result.add(test);
            }
        }

View Full Code Here

            InterfaceType type = deploymentInfo.getInterfaceType(method.getDeclaringClass());

            String name = (type == null) ? null : type.getSpecName();

            Permission permission = new EJBMethodPermission(ejbName, name, method);

            AccessControlContext accessContext = ContextManager.getCurrentContext();

            if (permission != null) accessContext.checkPermission(permission);
View Full Code Here

  /**
   * Permission will be named "invoke.<declaring-class>.<method-name>".
   */
  public static Permission getPermission(Method method) {
    Permission result = null;
    Class mc = method.getDeclaringClass();

    synchronized (invokePermissionCache) {
      Map permissions = (Map) invokePermissionCache.get(mc);

View Full Code Here

        try {
            // raises IOException if dbname is non-canonicalizable
            final String url
                = (DatabasePermission.URL_PROTOCOL_DIRECTORY
                   + stripSubSubProtocolPrefix(dbname));
            final Permission dp
                = new DatabasePermission(url, DatabasePermission.CREATE);
           
            factory.checkSystemPrivileges(user, dp);
        } catch (AccessControlException ace) {
            throw Util.generateCsSQLException(
View Full Code Here

TOP

Related Classes of java.security.Permission

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.