|
June 19, 2000 WMLScript's Access Control Pragmas Tips: June 2000
Yehuda Shiran, Ph.D.
|
|
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:
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:
The following URLs would be allowed to call the external function in the access-controlled compilation unit above:
But the following URLs would not be allowed to call the external functions:
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
For more on WMLScript, go to WMLScript Primer.
People who read this tip also read these tips: Look for similar tips by subject: |