Packages
 In this topic

*Constructors

*Methods

*Fields

 

Packages   PreviousThis PackageNext
Package com.ms.security.permissions   Previous This
Package
Next

 


Class RegistryRequest

public class RegistryRequest implements ISecurityRequest
{
  // Fields
  public static final int CREATE;
  public static final int DELETE;
  public static final int OPEN;
  public static final int READ;
  public static final int WRITE;

  // Constructors
  public RegistryRequest (int access, String value);

  // Methods
  public PermissionID getPermissionID();
  public String toString ();
}

This class represents a request for access to a registry key. It should be used as the security request object for a parameterized security check involving registry permissions. The RegistryPermission.check method expects a RegistryRequest object as its parameter.

The following example shows how to use a RegistryRequest object to perform a security check to see if a specific registry key can be accessed.


// Create a ReqistryRequest object that indicates that you want
// to read the registry key "HKLM\Software\stuff".

RegistryRequest sreq = 
   new RegistryRequest(RegistryRequest.READ,"HKLM\Software\stuff");

// Check to see that all of your callers have the rights to
// read that registry key.

PolicyEngine.checkPermission(sreq);	
...

For more information about checking registry permissions, see the com.ms.security.PolicyEngine class and the RegistryPermission class.

Constructors

RegistryRequest

public RegistryRequest (int access, String value);

Creates a RegistryRequest object based on the specified access type and value.

ParameterDescription
access The type of access requested. It must be one of the following: OPEN, READ, WRITE, DELETE, or CREATE.
value The key or value for which access is requested.

Methods

getPermissionID

public PermissionID getPermissionID();

Retrieves the permission identifier for the RegistryRequest object.

This method satisfies the ISecurityRequest interface and returns PermissionID.REGISTRY to indicate that instances of the RegistryRequest class are associated with the registry permission.

Return Value:

Returns PermissionID.REGISTRY.

toString

public String toString ();

Converts the RegistryRequest object to its string representation.

Return Value:

Returns the string representation of the RegistryRequest object.

Fields

CREATE
The registry access type that represents a request to create a key or value.
DELETE
The registry access type that represents a request to delete a key or value.
OPEN
The registry access type that represents an attempt to open a registry key.
READ
The registry access type that represents a request to read or obtain information about a key or value.
WRITE
The registry access type that represents a request to modify a key or value.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.