source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.6.2/manual/CoreTypes/permissions.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 7.0 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Permissions type</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="permissions">Permissions</a></h2>
12<p>
13Permissions represents a set of security permissions granted or revoked to
14a specific part code executed in the JVM where ant is running in.
15The actual Permissions are specified via a set of nested permission items either
16<code>&lt;grant&gt;</code>ed or <code>&lt;revoke&gt;</code>d.</p>
17<p>
18In the base situation a <a href="#baseset">base set</a> of permissions granted.
19Extra permissions can be
20granted. A granted permission can be overruled by revoking a permission.
21The security manager installed by the permissions will throw an
22<code>SecurityException</code> if
23the code subject to these permissions try to use an permission that has not been
24granted or that has been revoked.</p>
25<h3>Nested elements</h3>
26<h4>grant</h4>
27<p>
28Indicates a specific permission is always granted. Its attributes indicate which
29permissions are granted.</p>
30<table border="1" cellpadding="2" cellspacing="0">
31 <tr>
32 <td valign="top"><b>Attribute</b></td>
33 <td valign="top"><b>Description</b></td>
34 <td align="center" valign="top"><b>Required</b></td>
35 </tr>
36 <tr>
37 <td valign="top">class</td>
38 <td valign="top">The fully qualified name of the Permission class.</td>
39 <td valign="top" align="center">Yes</td>
40 </tr>
41 <tr>
42 <td valign="top">name</td>
43 <td valign="top">The name of the Permission. The actual contents depends on the
44 Permission class.</td>
45 <td valign="top" align="center">No</td>
46 </tr>
47 <tr>
48 <td valign="top">actions</td>
49 <td valign="top">The actions allowed. The actual contents depend on the
50 Permission class and name.</td>
51 <td valign="top" align="center">No</td>
52 </tr>
53</table>
54<p>
55Implied permissions are granted.
56</p>
57<p>
58Please 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
59Permission class.
60</p>
61<h4>revoke</h4>
62<p>
63Indicates a specific permission is revoked.</p>
64<table border="1" cellpadding="2" cellspacing="0">
65 <tr>
66 <td valign="top"><b>Attribute</b></td>
67 <td valign="top"><b>Description</b></td>
68 <td align="center" valign="top"><b>Required</b></td>
69 </tr>
70 <tr>
71 <td valign="top">class</td>
72 <td valign="top">The fully qualified name of the Permission class.</td>
73 <td valign="top" align="center">Yes</td>
74 </tr>
75 <tr>
76 <td valign="top">name</td>
77 <td valign="top">The name of the Permission. The actual contents depends on the
78 Permission class.</td>
79 <td valign="top" align="center">No</td>
80 </tr>
81 <tr>
82 <td valign="top">actions</td>
83 <td valign="top">The actions allowed. The actual contents depend on the
84 Permission class and name.</td>
85 <td valign="top" align="center">No</td>
86 </tr>
87</table>
88<p>
89Implied permissions are not resolved and therefore also not revoked.
90</p>
91<p>
92The name can handle the * wildcard at the end of the name, in which case all
93permissions of the specified class of which the name starts with the specified name
94(excluding the *) are revoked. Note that the - wildcard often supported by the
95granted properties is not supported.
96If the name is left empty all names match, and are revoked.
97If the actions are left empty all actions match, and are revoked.
98</p>
99<a name="baseset"></a><h3>Base set</h3>
100A permissions set implictly contains the following permissions:
101<blockquote><pre>
102&lt;grant class=&quot;java.net.SocketPermission&quot; name=&quot;localhost:1024-&quot; actions=&quot;listen&quot;&gt;
103&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.version&quot; actions=&quot;read&quot;&gt;
104&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vendor&quot; actions=&quot;read&quot;&gt;
105&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vendor.url&quot; actions=&quot;read&quot;&gt;
106&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.class.version&quot; actions=&quot;read&quot;&gt;
107&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;os.name&quot; actions=&quot;read&quot;&gt;
108&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;os.version&quot; actions=&quot;read&quot;&gt;
109&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;os.arch&quot; actions=&quot;read&quot;&gt;
110&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;file.encoding&quot; actions=&quot;read&quot;&gt;
111&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;file.separator&quot; actions=&quot;read&quot;&gt;
112&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;path.separator&quot; actions=&quot;read&quot;&gt;
113&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;line.separator&quot; actions=&quot;read&quot;&gt;
114&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.specification.version&quot; actions=&quot;read&quot;&gt;
115&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.specification.vendor&quot; actions=&quot;read&quot;&gt;
116&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.specification.name&quot; actions=&quot;read&quot;&gt;
117&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.specification.version&quot; actions=&quot;read&quot;&gt;
118&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.specification.vendor&quot; actions=&quot;read&quot;&gt;
119&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.specification.name&quot; actions=&quot;read&quot;&gt;
120&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.version&quot; actions=&quot;read&quot;&gt;
121&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.vendor&quot; actions=&quot;read&quot;&gt;
122&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.name&quot; actions=&quot;read&quot;&gt;
123</blockquote></pre>
124These permissions can be revoked via &lt;revoke&gt; elements if necessary.
125
126<h3>Examples</h3>
127<blockquote><pre>
128&lt;permissions&gt;
129 &lt;grant class=&quot;java.security.AllPermission&quot;/&gt;
130 &lt;revoke class=&quot;java.util.PropertyPermission&quot;/&gt;
131&lt;/permissions&gt;
132</pre></blockquote>
133<p>
134Grants all permissions to the code except for those handling Properties.
135</p>
136<blockquote><pre>
137&lt;permissions&gt;
138 &lt;grant class=&quot;java.net.SocketPermission&quot; name=&quot;foo.bar.com&quot; action=&quot;connect&quot;/&gt;
139 &lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;user.home&quot; action=&quot;read,write&quot;/&gt;
140&lt;/permissions&gt;
141</pre></blockquote>
142<p>
143Grants the base set of permissions with the addition of a SocketPermission to connect
144to foo.bar.com and the permission to read and write the user.home system property.
145</p>
146<hr>
147<p align="center">Copyright &copy; 2003-2004 The Apache Software Foundation.
148All rights Reserved.</p>
149</body>
150</html>
Note: See TracBrowser for help on using the repository browser.