001/* AuthPermission.java -- permissions related to authentication. 002 Copyright (C) 2004 Free Software Foundation, Inc. 003 004This file is part of GNU Classpath. 005 006GNU Classpath is free software; you can redistribute it and/or modify 007it under the terms of the GNU General Public License as published by 008the Free Software Foundation; either version 2, or (at your option) 009any later version. 010 011GNU Classpath is distributed in the hope that it will be useful, but 012WITHOUT ANY WARRANTY; without even the implied warranty of 013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014General Public License for more details. 015 016You should have received a copy of the GNU General Public License 017along with GNU Classpath; see the file COPYING. If not, write to the 018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 01902110-1301 USA. 020 021Linking this library statically or dynamically with other modules is 022making a combined work based on this library. Thus, the terms and 023conditions of the GNU General Public License cover the whole 024combination. 025 026As a special exception, the copyright holders of this library give you 027permission to link this library with independent modules to produce an 028executable, regardless of the license terms of these independent 029modules, and to copy and distribute the resulting executable under 030terms of your choice, provided that you also meet, for each linked 031independent module, the terms and conditions of the license of that 032module. An independent module is a module which is not derived from 033or based on this library. If you modify this library, you may extend 034this exception to your version of the library, but you are not 035obligated to do so. If you do not wish to do so, delete this 036exception statement from your version. */ 037 038 039package javax.security.auth; 040 041import java.security.BasicPermission; 042 043/** 044 * <p>A permission controlling access to authentication service. The 045 * <i>actions</i> field of auth permission objects is ignored; the whole 046 * of the permission is defined by the <i>target</i>.</p> 047 * 048 * <p>The authentication permission targets recognized are:</p> 049 * 050 * <dl> 051 * <dt><code>doAs</code></dt> 052 * 053 * <dd><p>Allows access to the {@link 054 * Subject#doAs(javax.security.auth.Subject java.security.PrivilegedAction)} 055 * methods.</p></dd> 056 * 057 * <dt><code>doAsPrivileged</code></dt> 058 * 059 * <dd><p>Allows access to the {@link 060 * Subject#doAsPrivileged(javax.security.auth.Subject, 061 * java.security.PrivilegedAction, java.security.AccessControlContext)} 062 * methods.</p></dd> 063 * 064 * <dt><code>getSubject</code></dt> 065 * 066 * <dd><p>Allows access to the {@link Subject} associated with a 067 * thread.</p></dd> 068 * 069 * <dt><code>getSubjectFromDomainCombiner</code></dt> 070 * 071 * <dd><p>Allows access to the {@link Subject} associated with a 072 * {@link SubjectDomainCombiner}.</p></dd> 073 * 074 * <dt><code>setReadOnly</code></dt> 075 * 076 * <dd><p>Allows a {@link Subject} to be marked as read-only.</p></dd> 077 * 078 * <dt><code>modifyPrincipals</code></dt> 079 * 080 * <dd><p>Allows the set of principals of a subject to be modified.</p></dd> 081 * 082 * <dt><code>modifyPublicCredentials</code></dt> 083 * 084 * <dd><p>Allows the set of public credentials of a subject to be 085 * modified.</p></dd> 086 * 087 * <dt><code>modifyPrivateCredentials</code></dt> 088 * 089 * <dd><p>Allows the set of private credentials of a subject to be 090 * modified.</p></dd> 091 * 092 * <dt><code>refreshCredential</code></dt> 093 * 094 * <dd><p>Allows a {@link Refreshable} credential to be refreshed.</p></dd> 095 * 096 * <dt><code>destroyCredential</code></dt> 097 * 098 * <dd><p>Allows a {@link Destroyable} credential to be destroyed.</p></dd> 099 * 100 * <dt><code>createLoginContext.<i>name</i></code></dt> 101 * 102 * <dd><p>Allows a {@link javax.security.auth.login.LoginContext} for the 103 * given <i>name</i>. <i>name</i> can also be a wildcard (<code>'*'</code>), 104 * which allows the creation of a context with any name.</p></dd> 105 * 106 * <dt><code>getLoginConfiguration</code></dt> 107 * 108 * <dd><p>Allows the system-wide login {@link 109 * javax.security.auth.login.Configuration} to be retrieved.</p></dd> 110 * 111 * <dt><code>setLoginConfiguration</code></dt> 112 * 113 * <dd><p>Allows the system-wide login {@link 114 * javax.security.auth.login.Configuration} to be set.</p></dd> 115 * 116 * <dt><code>refreshLoginConfiguration</code></dt> 117 * 118 * <dd><p>Allows the system-wide login {@link 119 * javax.security.auth.login.Configuration} to be refreshed.</p></dd> 120 * </dl> 121 */ 122public final class AuthPermission extends BasicPermission 123{ 124 125 /** 126 * Creates a new authentication permission for the given target name. 127 * 128 * @param name The target name. 129 */ 130 public AuthPermission (String name) 131 { 132 super (name); 133 } 134 135 /** 136 * Creates a new authentication permission for the given target name. 137 * The actions list is not used by this class. 138 * 139 * @param name The target name. 140 * @param actions The action list. 141 */ 142 public AuthPermission (String name, String actions) 143 { 144 super (name, actions); 145 } 146}