ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/rootprmt.htm

120 lines
7.1 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="RootPermission" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rootprmt" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>RootPermission</title>
</head>
<body id="rootprmt"><a name="rootprmt"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">RootPermission</h1>
<div><p></p>
<div class="section"><p><a href="javadoc/com/ibm/as400/access/RootPermission.html"> RootPermission</a> is a subclass of the <a href="prmintro.htm#prmintro__userpermission"> UserPermission</a>
class. The RootPermission class allows you to display and set the permissions
for the user of an object contained in the root directory structure.</p>
</div>
<div class="section"><p>An object on the root directory structure can set the data authority
or the object authority. You can set the data authority to the values listed
in the following table. Use the <a href="javadoc/com/ibm/as400/access/RootPermission.html#GETDATAAUTHORITY()"> getDataAuthority()</a> method to to display the current
values and the <a href="javadoc/com/ibm/as400/access/RootPermission.html#SETDATAAUTHORITY(JAVA.LANG.STRING)"> setDataAuthority()</a> method to set the data authority.</p>
</div>
<div class="section"><p>The following table lists and describes the valid data authority
values:</p>
</div>
<div class="section"><div class="p">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr class="tablemainheaderbar"><th valign="top" width="22.22222222222222%" id="d0e39">Data authority value</th>
<th valign="top" width="77.77777777777779%" id="d0e41">Description</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*none</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has no authority to the object.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*RWX</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has read, add, update, delete, and execute authorities.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*RW</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has read, add, and delete authorities.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*RX</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has read and execute authorities.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*WX</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has add, update, delete, and execute authorities.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*R</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has read authority.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*W</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has add, update, and delete authorities.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*X</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user has execute authority.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*EXCLUDE</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The user cannot access the object.</td>
</tr>
<tr><td valign="top" width="22.22222222222222%" headers="d0e39 ">*AUTL</td>
<td valign="top" width="77.77777777777779%" headers="d0e41 ">The public authorities on this object come from the authorization list.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section"><p>The object authority can be set to one or more of the following
values: alter, existence, management, or reference. You can use the <a href="javadoc/com/ibm/as400/access/RootPermission.html#SETALTER(BOOLEAN)"> setAlter()</a>, <a href="javadoc/com/ibm/as400/access/RootPermission.html#SETEXISTENCE(BOOLEAN)"> setExistence()</a>, <a href="javadoc/com/ibm/as400/access/RootPermission.html#SETMANAGEMENT(BOOLEAN)"> setManagement()</a>, or <a href="javadoc/com/ibm/as400/access/RootPermission.html#SETREFERENCE(BOOLEAN)"> setReference()</a> methods to set the values on or off.</p>
</div>
<div class="section"><p>After setting either the data authority or the object authority
of an object, it is important that you use the <a href="javadoc/com/ibm/as400/access/Permission.html#COMMIT()"> commit()</a> method from the <a href="prmintro.htm#prmintro">Permissions</a> class
to send the changes to the server.</p>
</div>
<div class="section"><p>For more information about the different authorities, see Chapter
5: Resource Security in the <strong><a href="../books/sc415302.pdf">iSeries™ Security
Reference</a></strong> <img src="wbpdf.gif" alt="Link to PDF" />.</p>
</div>
<div class="section"><p><strong>Example</strong></p>
</div>
<div class="section"><p>This example shows you how to retrieve and print the permissions
for a root object.</p>
</div>
<div class="section"><div class="p"><pre> // Create a system object.
AS400 sys = new AS400("MYAS400", "USERID", "PASSWORD");
// Represent the permissions to an object in the root file system.
Permission objectInRoot = new Permission(sys, "/fred");
// Print the object pathname and retrieve its permissions.
System.out.println("Permissions on "+objectInRoot.getObjectPath()+" are as follows:");
Enumeration enum = objectInRoot.getUserPermissions();
while (enum.hasMoreElements())
{
// For each of the permissions, print out the user profile name
// and that user's authorities to the object.
RootPermission rootPerm = (RootPermission)enum.nextElement();
System.out.println(rootPerm.getUserID()+": "+rootPerm.getDataAuthority());
}</pre>
</div>
</div>
</div>
</body>
</html>