Packages
 In this topic

*Constructors

*Methods

*Fields

 

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

 


Class PropertyAccessRequest

public class PropertyAccessRequest implements ISecurityRequest
{
  // Fields
  public static final int ALL;
  public static final int INDIVIDUAL;

  // Constructors
  public PropertyAccessRequest (int type,String param);
  public PropertyAccessRequest();
  public PropertyAccessRequest (String prop);

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

This class represents a request to access the system properties. Use an instance of this class as the security request object for a parameterized security check involving the system properties permission. The PropertyPermission.check method expects a PropertyAccessRequest object as its parameter.

The following example shows how to use a PropertyAccessRequest object to perform a security check.


... 
// Create a PropertyAccessRequest object that indicates  
// that you want to read the system property called 
// java.class.path.

PropertyAccessRequest sreq = 
   new PropertyAccessRequest("java.class.path");

// Check to see that all of your callers have the 
// rights to read that system property.

PolicyEngine.checkPermission(sreq);  
...

For more information about checking system properties, see the PolicyEngine class and the PropertyPermission class.

Constructors

PropertyAccessRequest

public PropertyAccessRequest (int type,String param);

Creates a property access request for a specified access type and a specified property.

Return Value:

Returns the request object that represents a request for access to the specified property.

ParameterDescription
type The type of property access. This can be ALL or INDIVIDUAL.
param If type is INDIVIDUAL, this value should be the property name for the specified access type. If type is ALL, the value should be null.

PropertyAccessRequest

public PropertyAccessRequest();

Creates a property access request that indicates a request for unrestricted access to properties.

Return Value:

Returns the request object that indicates a request to access all system properties.

PropertyAccessRequest

public PropertyAccessRequest (String prop);

Creates a request object that represents an attempt to read the specified property.

Return Value:

Returns the request object that represents an attempt to read the specified property.

ParameterDescription
prop The name of the system property to read.

Methods

getPermissionID

public PermissionID getPermissionID();

Retrieves the permission identifier for the PropertyAccessRequest object.

Return Value:

Returns PermissionID.PROPERTY.

Remarks:

This method satisfies the ISecurityRequest interface and returns PermissionID.PROPERTY to indicate that instances of the PropertyAccessRequest class are associated with the system property permission.

toString

public String toString ();

Converts the PropertyAccessRequest object to its string representation.

Return Value:

Returns the string representation of the PropertyAccessRequest object.

Fields

ALL
The system property access type that indicates the unrestricted ability to read and modify all system properties.
INDIVIDUAL
The system property access type that indicates the ability to read the contents of a single specified system property.

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