|
|
Start of Tutorial > Start of Trail |
Search
Feedback Form |
This lesson demonstrates how to write a class that defines its own special permission. The basic components in this lesson include:The basic scenario is as follows:
- A sample game called TerrysGame.
- A class called HighScore, which is used by
TerrysGameto store a user's latest high score.
- A class called HighScorePermission, which is used to protect access to the user's stored high score value.
- A user's security policy file, which grants permission to
TerrysGameto update his/her high score.
- A user plays
TerrysGame.
- If the user reaches a new high score,
TerrysGameuses theHighScoreclass to save this new value.
- The
HighScoreclass looks into the user's security policy to check ifTerrysGamehas permission to update the user's high score value.
- If
TerrysGamehas permission to update the high score, then the HighScore class updates that value.We describe the key points of each of the basic components and then show a sample run:
|
|
Start of Tutorial > Start of Trail |
Search
Feedback Form |
Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.