When you incorporate a URL into an activity--for example by requesting it with a GO task--you gain access to any variables it uses. This poses a potential security risk. To allow you to control this risk, HDML and the UP.Browser support access control, which allows you to specify which URLs can incorporate a URL into an activity.
The default settings for access control allow you to incorporate any URLs on the same domain into an activity. For example, the two decks in Figure 2-16 are located in different directories. However, because they are hosted on the same domain, the default access control settings allow you to create an activity that spans both decks.
FIGURE 2-16. Activity that spans decks in different directories
Suppose the domain of the second deck were different from the domain of the first deck, as shown in Figure 2-17. The default access control settings do not allow the first deck to include the second deck in the same activity. When the user presses ACCEPT in the first deck, the phone displays an error message (the detailed message is: "Access Control Error").
FIGURE 2-17. Activity that unsuccessfully attempts to span decks on different domains
Generally, you don't need to change the default access control settings unless:
To configure access control, you use the following HDML options:
PUBLIC (deck option). Enables access control for a deck. Setting PUBLIC to FALSE limits the URLs that can include the deck in an activity, according to the ACCESSDOMAIN and ACCESSPATH option settings (described below). Setting it to TRUE allows any URL to link to cards in the deck. It is set to FALSE by default.
ACCESSDOMAIN (deck option). Specifies the domain of URLs that can include the deck's cards in an activity (when PUBLIC is set to FALSE).
ACCESSPATH (deck option). Specifies the base path of URLs that can include the deck's cards in an activity (when PUBLIC is set to FALSE).
FRIEND (task option). Specifies whether a nested activity can clear the current activity's variables and whether it can override the current activity's NEXT and CANCEL options.
For example, to make the activity in Figure 2-17 work correctly, you could either set the PUBLIC option for deck2.hdml to TRUE or you could set the ACCESSDOMAIN option as shown in Figure 2-18.
FIGURE 2-18. Activity that spans decks on different domains
If the PUBLIC option for a deck is set to FALSE (the default), the phone uses the deck's ACCESSDOMAIN and ACCESSPATH options to determine which other URLs can link to cards within the deck. The phone uses a prefix match to match a deck's ACCESSDOMAIN and ACCESSPATH options with the URLs of decks that attempt to link to it.
ACCESSDOMAIN option of the deck it attempts to link to; it does not resolve names or aliases into canonical domain names. For example, if you load a deck with the URL http://red.uplanet.com/deck.hdml, the phone does not allow it to link to a deck with the ACCESSDOMAIN option set to 204.163.165.250 (even though 204.163.165.250 specifies the same domain as red.uplanet.com). You must load the deck using the URL http://204.163.165.250/deck.hdml for it to link to a deck with the ACCESSDOMAIN option set to 204.163.165.250.
Suppose a deck's URL is http://my.com/mydeck.hdml. The following table demonstrates the effects of different combinations of ACCESSDOMAIN and ACCESSPATH settings:
The following table lists the ways you can request a destination and the HDML options the destination deck must specify to allow you to access it.