home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / awt / AWTPermission.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  4.7 KB  |  142 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)AWTPermission.java    1.11 98/10/02
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt;
  16.  
  17. import java.security.BasicPermission;
  18.  
  19. /**
  20.  * This class is for AWT permissions.
  21.  * An AWTPermission contains a target name but
  22.  * no actions list; you either have the named permission
  23.  * or you don't.
  24.  *
  25.  * <P>
  26.  * The target name is the name of the AWT permission (see below). The naming
  27.  * convention follows the hierarchical property naming convention.
  28.  * Also, an asterisk could be used to represent all AWT permissions.
  29.  *
  30.  * <P>
  31.  * The following table lists all the possible AWTPermission target names,
  32.  * and for each provides a description of what the permission allows
  33.  * and a discussion of the risks of granting code the permission.
  34.  * <P>
  35.  *
  36.  * <table border=1 cellpadding=5>
  37.  * <tr>
  38.  * <th>Permission Target Name</th>
  39.  * <th>What the Permission Allows</th>
  40.  * <th>Risks of Allowing this Permission</th>
  41.  * </tr>
  42.  *
  43.  * <tr>
  44.  *   <td>accessClipboard</td>
  45.  *   <td>Posting and retrieval of information to and from the AWT clipboard</td>
  46.  *   <td>This would allow malfeasant code to share
  47.  * potentially sensitive or confidential information.</td>
  48.  * </tr>
  49.  *
  50.  * <tr>
  51.  *   <td>accessEventQueue</td>
  52.  *   <td>Access to the AWT event queue</td>
  53.  *   <td>After retrieving the AWT event queue,
  54.  * malicious code may peek at and even remove existing events
  55.  * from its event queue, as well as post bogus events which may purposefully
  56.  * cause the application or applet to misbehave in an insecure manner.</td>
  57.  * </tr>
  58.  *
  59.  * <tr>
  60.  *   <td>listenToAllAWTEvents</td>
  61.  *   <td>Listen to all AWT events, system-wide</td>
  62.  *   <td>After adding an AWT event listener,
  63.  * malicious code may scan all AWT events dispatched in the system,
  64.  * allowing it to read all user input (such as passwords).  Each
  65.  * AWT event listener is called from within the context of that
  66.  * event queue's EventDispatchThread, so if the accessEventQueue
  67.  * permission is also enabled, malicious code could modify the
  68.  * contents of AWT event queues system-wide, causing the application
  69.  * or applet to misbehave in an insecure manner.</td>
  70.  * </tr>
  71.  *
  72.  * <tr>
  73.  *   <td>showWindowWithoutWarningBanner</td>
  74.  *   <td>Display of a window without also displaying a banner warning
  75.  * that the window was created by an applet</td>
  76.  *   <td>Without this warning,
  77.  * an applet may pop up windows without the user knowing that they
  78.  * belong to an applet.  Since users may make security-sensitive
  79.  * decisions based on whether or not the window belongs to an applet
  80.  * (entering a username and password into a dialog box, for example),
  81.  * disabling this warning banner may allow applets to trick the user
  82.  * into entering such information.</td>
  83.  * </tr>
  84.  *
  85.  * <tr>
  86.  *   <td>readDisplayPixels</td>
  87.  *   <td>Readback of pixels from the display screen</td>
  88.  *   <td>Interfaces such as the java.awt.Composite interface which
  89.  * allow arbitrary code to examine pixels on the display enable
  90.  * malicious code to snoop on the activities of the user.</td>
  91.  * </tr>
  92.  *
  93.  * </table>
  94.  *
  95.  * @see java.security.BasicPermission
  96.  * @see java.security.Permission
  97.  * @see java.security.Permissions
  98.  * @see java.security.PermissionCollection
  99.  * @see java.lang.SecurityManager
  100.  *
  101.  * @version 1.11 99/03/26
  102.  *
  103.  * @author Marianne Mueller
  104.  * @author Roland Schemers
  105.  */
  106.  
  107. public final class AWTPermission extends BasicPermission {
  108.  
  109.     /** use serialVersionUID from JDK 1.2 for interoperability */
  110.     private static final long serialVersionUID = 8890392402588814465L;
  111.  
  112.     /**
  113.      * Creates a new AWTPermission with the specified name.
  114.      * The name is the symbolic name of the AWTPermission, such as
  115.      * "topLevelWindow", "systemClipboard", etc. An asterisk
  116.      * may be used to indicate all AWT permissions.
  117.      *
  118.      * @param name the name of the AWTPermission.
  119.      */
  120.  
  121.     public AWTPermission(String name)
  122.     {
  123.     super(name);
  124.     }
  125.  
  126.     /**
  127.      * Creates a new AWTPermission object with the specified name.
  128.      * The name is the symbolic name of the AWTPermission, and the
  129.      * actions String is currently unused and should be null. This
  130.      * constructor exists for use by the <code>Policy</code> object
  131.      * to instantiate new Permission objects.
  132.      *
  133.      * @param name the name of the AWTPermission.
  134.      * @param actions should be null.
  135.      */
  136.  
  137.     public AWTPermission(String name, String actions)
  138.     {
  139.     super(name, actions);
  140.     }
  141. }
  142.