spacer
Yehuda Shiran June 19, 2000
WMLScript's Access Control Pragmas
Tips: June 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

WMLScript is a compiled language and uses Compilation Units and Pragmas. A certain application may include separate scripts that were individually and independently compiled. A compilation unit can call functions that are defined in another compilation unit. WMLScript uses the access control pragma to specify the access control of the WMLScript deck. Every compilation unit can have only one access control pragma. The access control pragma specify which URLs can call the external functions in the access-controlled compilation unit. The syntax of access control pragma may be specified in any one of the following forms:

use access domain 
use access domain ;
use access path ;
use access domain  path ;

The referring compilation unit's URL must match the access control specification. A URL consists of a domain name and a path. The referring compilation unit's domain name is matched with the access domain specification, while the compilation unit's path is matched with the access path specification. The domain matching is guided by two principles. First, they are suffix matched, i.e. matching is done from right to left. Secondly, entire sub-domain elements mush match. Given the following access control for a compilation unit:

use access domain "webreference.com" path "/js";

The following URLs would be allowed to call the external function in the access-controlled compilation unit above:

http://webreference.com/js/tips.cgi
https://www.webreference.com/js/categories.wmlsc
http://www.webreference.com/js/tools/newtool.cgi?x=123<y=456

But the following URLs would not be allowed to call the external functions:

http://www.microsoft.com/javascript
http://www.webreference.com/dhtml/mytool.cgi

As you can notice, the access path is prefix-matched, i.e. from left to right. The same principles hold here as well, including that entire sub elements must be matched. The path /js will not match /j/mytools, for example. By default, access control is disabled, so all external functions have public access.

For more on WMLScript, go to WMLScript Primer.


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Top 10 Threats to Wireless Security · Poll: UC Uptake on the Rise · Review: Fluke AirCheck Wi-Fi Tester 1.0