githubEdit

Restricted Actions

The RestrictedActions module allows scenes to access sensitive (and thus restricted) functionality. It's linked to the permissionarrow-up-right system, which scenes use to request the use of individual methods.

const RestrictedActions = require("~system/RestrictedActions");
circle-info

As a World Explorer implementer, your runtime could have no enforcement of permissions. We strongly advise against this, since it puts players in danger.

Most of the restricted functionality is provided by this module, but there's also restricted global functionsarrow-up-right.

The module contains the following methods and types:

Methods

Each of the methods below is associated with a specific permissionarrow-up-right that can be requested in the scene manifest.

movePlayerTo

Displace the player to a new position relative to the current one, and optionally set the camera target with vectors.

Requires the ALLOW_TO_MOVE_PLAYER_INSIDE_SCENEarrow-up-right permission.

teleportTo

Reposition the player to an absolute world location given a by vectors.

Instead of requiring a pre-approved permission, each call to teleportTo must be approved by the player.

triggerEmote

Make the player's avatar display an emote animation, using one of the predefined names.

Requires the ALLOW_TO_TRIGGER_AVATAR_EMOTEarrow-up-right permission.

openExternalUrl

Offer to show a website to the player, using an appropriate UI (which may be another application).

Requires the OPEN_EXTERNAL_LINKarrow-up-right permission.

openNftDialog

Show information about an NFT to the player, using an appropriate UI.

changeRealm

Switch the World Explorer to another content server, using its base URL.

Types

The only additional type used by methods in this module is the Vector3.

Vector3

Holds a relative or absolute 3d position.

Last updated