Download presentation
Presentation is loading. Please wait.
1
Security Managers and Permissions
2
Contents Problem Description Solution
3
I. Problem Description Develop a program that allows the user to check whether the text input contains bad words or not. A sentence is considered to have bad words if it contains either “sex” or “drug”. However, the sentence is not bad if it contains either “drugget”, “druggist”, or “drugstore”. A sample GUI is shown in the next slide.
5
II. Solution Developing the Model Developing the View
Adding a Listener to Insert Button
6
1. Developing the Model 1.1 Creating a .policy File in the Project's Root Folder 1.2 Developing the Test Class 1.3 Developing the WordCheck Class 1.4 Developing the WordPermission Class 1.5 Running the Test Class
7
1.1 Creating a .policy File in the Project's Root Folder
This policy is for two actions: avoid and insert
8
1.2 Developing the Test Class
java -Djava.security.manager -Djava.security.policy=WordPermission.policy permission.model.WordCheckTest
9
1.3 Developing the WordCheck Class
10
1.4 Developing the WordPermission Class
13
1.5 Running the Test Class MUST run using the command line!
14
2. Developing the View
16
3. Adding a Listener to Insert Button
3.1 Setting the Policy 3.2 Developing the Listener
17
3.1 Setting the Policy
18
3.2 Developing the Listener
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.