Java Permissions

  

The permission classes encapsulate the access to system resources. Table 26-1 describes the basic Java built-in permissions. There are many more classes (not only in the security package) that provide specific functionality, such as java.io.FilePermission for file permissions.

Table 26-1: Basic Java Built-in Permission Classes

Class

Description

java.security.Permission

This abstract class defines the essential functionalities required for all permissions.

java.security.PermissionCollection

Each instance of this class holds only permissions of the same type.

java.security.Permissions

This class is designed to hold a heterogeneous collection of permissions. Basically, it is a collection of java.security.PermissionCollection objects.

Cross-Reference  

See Chapter 19 for more information about Java permissions and the permission set.

Recall that permissions are usually compared against each other. The implies method is crucial because it allows for this comparison to happen. For instance, if you have permission to write to a file, it implies that you can read it. That is, java.io.FilePermission("/myfile.txt", "write") implies java.io.FilePermission("/myfile.txt", "read") .

Tip  

You must be careful how you use the implies method because you can give code more permissions than is obvious, such as allowing the setting of system properties. For more information about permissions refer to http://java.sun.com/j2se/ sdk/1.2/docs/guide/ security/permissions.html.

  


Java Security Solutions
Java Security Solutions
ISBN: 0764549286
EAN: 2147483647
Year: 2001
Pages: 222

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net