Skip to content

Permissions

Some things a script can do affect an avatar directly: animating it, taking its controls, moving its camera, attaching to it, teleporting it or spending its owner’s money. Before a script may do any of these, an avatar has to grant it the matching runtime permission. These are separate from the permission masks on inventory items, which control copying, modifying and transferring.

A script asks with llRequestPermissions, and the answer arrives in the run_time_permissions event. Each permission is a bit in a script permission mask.

Concepts

Functions and events

These are the functions and events for requesting and checking permissions.

llRequestPermissions(key agent, integer permissions)
eventrun_time_permissions(integer perm)
integerllGetPermissions()
keyllGetPermissionsKey()
llRequestExperiencePermissions(key agent, string name)
eventexperience_permissions(key agent_id)
eventexperience_permissions_denied(key agent_id, integer reason)

Requesting permissions

Request in response to the avatar, from touch_start, attach or a sit in changed, and act once the grant arrives:

default
{
touch_start(integer total_number)
{
llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
llStartAnimation("dance1");
}
}
PermissionValueAllowsGranted by
PERMISSION_DEBIT0x2Paying out L$ with llGiveMoney and llTransferLindenDollarsOwner
PERMISSION_TAKE_CONTROLS0x4Capturing movement keys with llTakeControlsAny avatar
PERMISSION_TRIGGER_ANIMATION0x10Starting and stopping animationsAny avatar
PERMISSION_ATTACH0x20Attaching and detaching the objectOwner
PERMISSION_CHANGE_LINKS0x80Linking and unlinking primsOwner
PERMISSION_TRACK_CAMERA0x400Reading the camera position and rotationAny avatar
PERMISSION_CONTROL_CAMERA0x800Setting and clearing camera parametersSitting or wearing avatar
PERMISSION_TELEPORT0x1000Teleporting with llTeleportAgentAny avatar
PERMISSION_SILENT_ESTATE_MANAGEMENT0x4000Changing estate access with llManageEstateAccessOwner
PERMISSION_OVERRIDE_ANIMATIONS0x8000Replacing default animationsAny avatar
PERMISSION_RETURN_OBJECTS0x10000Returning objects by key or by ownerOwner
PERMISSION_PRIVILEGED_LAND_ACCESS0x80000Selling parcels with llSetParcelForSaleOwner
PERMISSION_GAME_CONTROL0x100000Receiving game control inputAny avatar

Scripting Details

Here are the functions and events in detail.

llRequestPermissions(key agent, integer permissions)
Requests permissions (a bitfield specified by permissions) from the agent in the same region, calling run_time_permissions if granted. This call does not pause script execution.
eventrun_time_permissions(integer perm)
Triggered when an agent grants or denies runtime permissions requested by llRequestPermissions. Passes the active integer permissions bitfield perm (returns 0 if no permissions are currently granted).
integerllGetPermissions()
Returns an integer bitfield representing the permissions (PERMISSION_*) currently granted to the script.
keyllGetPermissionsKey()
Returns the key (UUID) of the avatar that last granted or declined permissions to the script, or NULL_KEY if the permissions request was ignored or cancelled.
llRequestExperiencePermissions(key agent, string name)
Requests permission from the specified agent to participate in the experience. These permissions are persistent and apply grid-wide across all scripts in the experience, automatically triggering experience_permissions or experience_permissions_denied.
eventexperience_permissions(key agent_id)
Triggered when the agent specified by agent_id approves an experience permissions request (interactively or automatically if previously approved).
eventexperience_permissions_denied(key agent_id, integer reason)
Triggered when the agent specified by agent_id denies experience permissions, or when permission is blocked for other reasons (specified by the error code reason).

Constant groups ScriptPermission 13

See also Feature ExperienceFeature MoneyFeature InputFeature AvatarsFeature CameraCategory PermissionsPlanned Recipe: animation and control HUD