2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2003-08-27 14:23:17 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2003-08-27 14:23:17 +00:00
|
|
|
<title>Permissions type</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2018-02-08 16:59:52 +01:00
|
|
|
<h2 id="permissions">Permissions</h2>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Permissions represents a set of security permissions granted or revoked to a specific part
|
|
|
|
code executed in the JVM where Apache Ant is running in. The actual Permissions are specified
|
|
|
|
via a set of nested permission items either <code><grant></code>ed
|
|
|
|
or <code><revoke></code>d.</p>
|
|
|
|
<p>In the base situation a <a href="#baseset">base set</a> of permissions granted. Extra
|
|
|
|
permissions can be granted. A granted permission can be overruled by revoking a permission. The
|
|
|
|
security manager installed by the permissions will throw an <code>SecurityException</code> if
|
|
|
|
the code subject to these permissions try to use an permission that has not been granted or that
|
|
|
|
has been revoked.</p>
|
2003-08-27 14:23:17 +00:00
|
|
|
<h3>Nested elements</h3>
|
|
|
|
<h4>grant</h4>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Indicates a specific permission is always granted. Its attributes indicate which permissions
|
|
|
|
are granted.</p>
|
|
|
|
<table class="attr">
|
2003-08-27 14:23:17 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>class</td>
|
|
|
|
<td>The fully qualified name of the Permission class.</td>
|
|
|
|
<td>Yes</td>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>name</td>
|
|
|
|
<td>The name of the Permission. The actual contents depends on the Permission class.</td>
|
|
|
|
<td>No</td>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>actions</td>
|
|
|
|
<td>The actions allowed. The actual contents depend on the Permission class and name.</td>
|
|
|
|
<td>No</td>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Implied permissions are granted.</p>
|
|
|
|
<p>Please note that some Permission classes may actually need a name and/or actions in order to
|
|
|
|
function properly. The name and actions are parsed by the actual Permission class.</p>
|
2003-08-27 14:23:17 +00:00
|
|
|
<h4>revoke</h4>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Indicates a specific permission is revoked.</p>
|
|
|
|
<table class="attr">
|
2003-08-27 14:23:17 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>class</td>
|
|
|
|
<td>The fully qualified name of the Permission class.</td>
|
|
|
|
<td>Yes</td>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>name</td>
|
|
|
|
<td>The name of the Permission. The actual contents depends on the Permission class.</td>
|
|
|
|
<td>No</td>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>actions</td>
|
|
|
|
<td>The actions allowed. The actual contents depend on the Permission class and name.</td>
|
|
|
|
<td>No</td>
|
2003-08-27 14:23:17 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Implied permissions are not resolved and therefore also not revoked.</p>
|
|
|
|
<p>The <var>name</var> can handle the <q>*</q> wildcard at the end of the name, in which case
|
|
|
|
all permissions of the specified class of which the name starts with the specified name
|
|
|
|
(excluding the <q>*</q>) are revoked. Note that the <q>-</q> wildcard often supported by the
|
|
|
|
granted properties is not supported. If the <var>name</var> is left empty all names match, and
|
|
|
|
are revoked. If the <var>actions</var> are left empty all actions match, and are revoked.</p>
|
2018-02-08 16:59:52 +01:00
|
|
|
<h3 id="baseset">Base set</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>A permissions set implicitly contains the following permissions:</p>
|
2018-02-09 06:54:03 +01:00
|
|
|
<pre>
|
2003-09-01 10:13:44 +00:00
|
|
|
<grant class="java.net.SocketPermission" name="localhost:1024-" actions="listen">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.version" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vendor" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vendor.url" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.class.version" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="os.name" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="os.version" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="os.arch" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="file.encoding" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="file.separator" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="path.separator" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="line.separator" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.specification.version" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.specification.vendor" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.specification.name" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vm.specification.version" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vm.specification.vendor" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vm.specification.name" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vm.version" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vm.vendor" actions="read">
|
|
|
|
<grant class="java.util.PropertyPermission" name="java.vm.name" actions="read">
|
2018-02-09 06:54:03 +01:00
|
|
|
</pre>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>These permissions can be revoked via <code><revoke></code> elements if necessary.</p>
|
2003-08-27 14:23:17 +00:00
|
|
|
|
|
|
|
<h3>Examples</h3>
|
2018-02-09 06:54:03 +01:00
|
|
|
<pre>
|
2003-08-27 14:23:17 +00:00
|
|
|
<permissions>
|
|
|
|
<grant class="java.security.AllPermission"/>
|
|
|
|
<revoke class="java.util.PropertyPermission"/>
|
|
|
|
</permissions>
|
2018-02-09 06:54:03 +01:00
|
|
|
</pre>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Grants all permissions to the code except for those handling Properties.</p>
|
2018-02-09 06:54:03 +01:00
|
|
|
<pre>
|
2003-08-27 14:23:17 +00:00
|
|
|
<permissions>
|
|
|
|
<grant class="java.net.SocketPermission" name="foo.bar.com" action="connect"/>
|
|
|
|
<grant class="java.util.PropertyPermission" name="user.home" action="read,write"/>
|
|
|
|
</permissions>
|
2018-02-09 06:54:03 +01:00
|
|
|
</pre>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Grants the base set of permissions with the addition of a <code>SocketPermission</code> to
|
|
|
|
connect to <samp>foo.bar.com</samp> and the permission to read and write
|
|
|
|
the <code>user.home</code> system property.</p>
|
2006-09-11 04:33:25 +00:00
|
|
|
|
2003-08-27 14:23:17 +00:00
|
|
|
</body>
|
|
|
|
</html>
|