# llRequestPermissions

*LSL function*

```lsl
void llRequestPermissions(key agent, integer permissions);
```

- `key agent`: UUID of the agent in the same region.
- `integer permissions`: Bitfield containing the PERMISSION_* constants to request.

- Energy: 10

Ask **agent** for **permissions** to run certain classes of functions.

Script execution continues without waiting for a response. When a response is given, a [run_time_permissions](/events/run_time_permissions/) event is put in the event queue.

```lsl title="How to use" frame="terminal"
llRequestPermissions(NULL_KEY, 0);
```

## Specification

<table>
	<tr>
		<th colspan="2">Constants</th>
		<th>Action</th>
		<th>Category</th>
		<th>Granter</th>
		<th>Automatically granted when…</th>
	</tr>
	<tr>
		<td>[PERMISSION_DEBIT](/constants/PERMISSION_DEBIT/)</td>
		<td>`0x2`</td>
		<td>take money from agent's account</td>
		<td>[Money](/categories/money/)</td>
		<td>Owner</td>
		<td></td>
	</tr>
	<tr>
		<td>[PERMISSION_TAKE_CONTROLS](/constants/PERMISSION_TAKE_CONTROLS/)</td>
		<td>`0x4`</td>
		<td>take agent's [controls](/events/control/)</td>
		<td>[Control](https://wiki.secondlife.com/wiki/Category:LSL_Controls)</td>
		<td>Anyone</td>
		<td>sat on, attached</td>
	</tr>
	<tr>
		<td>[PERMISSION_TRIGGER_ANIMATION](/constants/PERMISSION_TRIGGER_ANIMATION/)</td>
		<td>`0x10`</td>
		<td>start or stop [Animations](/functions/llStartAnimation/) on agent</td>
		<td>[Animation](https://wiki.secondlife.com/wiki/Category:LSL_Animation)</td>
		<td>Anyone</td>
		<td>sat on, attached</td>
	</tr>
	<tr>
		<td>[PERMISSION_ATTACH](/constants/PERMISSION_ATTACH/)</td>
		<td>`0x20`</td>
		<td>[attach](/functions/llAttachToAvatar/)/[detach](/functions/llDetachFromAvatar/) from agent</td>
		<td>[Attachment](https://wiki.secondlife.com/wiki/Category:LSL_Attachment)</td>
		<td>[Owner](/functions/llAttachToAvatar/) or [Anyone](/functions/llAttachToAvatarTemp/)</td>
		<td>attached</td>
	</tr>
	<tr>
		<td>[PERMISSION_CHANGE_LINKS](/constants/PERMISSION_CHANGE_LINKS/)</td>
		<td>`0x80`</td>
		<td>change [links](https://wiki.secondlife.com/wiki/Category:LSL_Link)</td>
		<td>[Link](https://wiki.secondlife.com/wiki/Category:LSL_Link)</td>
		<td>Owner</td>
		<td></td>
	</tr>
	<tr>
		<td>[PERMISSION_TRACK_CAMERA](/constants/PERMISSION_TRACK_CAMERA/)</td>
		<td>`0x400`</td>
		<td>track the agent's [camera](/categories/camera/) [position](https://wiki.secondlife.com/wiki/Position) and [rotation](https://wiki.secondlife.com/wiki/rotation)</td>
		<td>[Camera](/categories/camera/)</td>
		<td>Anyone</td>
		<td>sat on, attached</td>
	</tr>
	<tr>
		<td>[PERMISSION_CONTROL_CAMERA](/constants/PERMISSION_CONTROL_CAMERA/)</td>
		<td>`0x800`</td>
		<td>control the agent's camera <br />([must be sat on or attached; automatically revoked on stand or detach](https://wiki.secondlife.com/wiki/LlSetCameraParams_Test))</td>
		<td>[Camera](/categories/camera/)</td>
		<td>Anyone</td>
		<td>sat on, attached</td>
	</tr>
	<tr>
		<td>[PERMISSION_TELEPORT](/constants/PERMISSION_TELEPORT/)</td>
		<td>`0x1000`</td>
		<td>[teleport](/functions/llTeleportAgent/) the agent</td>
		<td>[Teleport](/categories/teleport/)</td>
		<td>Anyone[^wiki-fa1a5b]</td>
		<td></td>
	</tr>
	<tr>
		<td>[PERMISSION_SILENT_ESTATE_MANAGEMENT](/constants/PERMISSION_SILENT_ESTATE_MANAGEMENT/)</td>
		<td>`0x4000`</td>
		<td>[manage estate access](/functions/llManageEstateAccess/) without notifying the owner of changes</td>
		<td>[Estate](https://wiki.secondlife.com/wiki/Category:LSL_Estate)</td>
		<td>Owner</td>
		<td></td>
	</tr>
	<tr>
		<td>[PERMISSION_OVERRIDE_ANIMATIONS](/constants/PERMISSION_OVERRIDE_ANIMATIONS/)</td>
		<td>`0x8000`</td>
		<td>configure the overriding of default [animations](/functions/llStartAnimation/) on agent</td>
		<td>[Animation](https://wiki.secondlife.com/wiki/Category:LSL_Animation)</td>
		<td>Anyone</td>
		<td>attached</td>
	</tr>
	<tr>
		<td>[PERMISSION_RETURN_OBJECTS](/constants/PERMISSION_RETURN_OBJECTS/)</td>
		<td>`0x10000`</td>
		<td>Used by [llReturnObjectsByOwner](/functions/llReturnObjectsByOwner/) and [llReturnObjectsByID](/functions/llReturnObjectsByID/) to return objects from parcels</td>
		<td>[Cleanup](https://wiki.secondlife.com/wiki/Category:LSL_Cleanup)</td>
		<td>Owner, Group Owner</td>
		<td></td>
	</tr>
	<tr>
		<td>[PERMISSION_PRIVILEGED_LAND_ACCESS](/constants/PERMISSION_PRIVILEGED_LAND_ACCESS/)</td>
		<td>`0x80000`</td>
		<td>Grants the script privileged access to land parcel functions, such as parcel sale. Used by [llSetParcelForSale](/functions/llSetParcelForSale/).</td>
		<td>[Land](https://wiki.secondlife.com/wiki/Category:LSL_Land)</td>
		<td>Owner</td>
		<td></td>
	</tr>
	<tr>
		<td>[PERMISSION_GAME_CONTROL](/constants/PERMISSION_GAME_CONTROL/)</td>
		<td>`0x100000`</td>
		<td>Permission to receive [game_control](/events/game_control/) input events.</td>
		<td>[Control](https://wiki.secondlife.com/wiki/Category:LSL_Controls)</td>
		<td>Anyone</td>
		<td>sat on, attached</td>
	</tr>
</table>

[^wiki-fa1a5b]: [PERMISSION_TELEPORT](/constants/PERMISSION_TELEPORT/) cannot be held by [temporary attachments](/functions/llAttachToAvatarTemp/).

## Caveats

- A dialog is presented to the agent to grant these permissions except when granted automatically as shown in the table above.
- If object is attached to agent, "automatic" permissions are granted without notification upon request.
- Permissions persist across state changes.
- Regardless of whether granting is automatic, you should always use the [run_time_permissions](/events/run_time_permissions/) event. Granting permissions takes time, and you shouldn't assume it's completed until the [run_time_permissions](/events/run_time_permissions/) handler gets invoked.
- The menu-option "Stop Animating Me" will release certain permissions ([PERMISSION_TRIGGER_ANIMATION](/constants/PERMISSION_TRIGGER_ANIMATION/) and [PERMISSION_OVERRIDE_ANIMATIONS](/constants/PERMISSION_OVERRIDE_ANIMATIONS/)), if the script which holds these permissions is in the same region as the agent, and the script is not attached to the permission granter.
- Permissions do not accumulate.
  - If a permission was requested with a previous call to this function and granted, then in subsequent call was not requested, that permission is released (lost).
  - To request two or more permissions at the same time, use the bitwise OR (|) operator, e.g.:

    ```lsl
    llRequestPermissions(AvatarID, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION)
    ```

- Permissions are requested and granted separately for each script, even if they are located in the same object.
- It is currently not possible to request no permissions at all (see Issues below); as a workaround [llResetScript](/functions/llResetScript/) can be used.
- Scripts may hold permissions for only one agent at a time. To hold permissions for multiple agents you must use more than one script.
- The result of granting permissions affects the return of [llGetPermissions](/functions/llGetPermissions/) and [llGetPermissionsKey](/functions/llGetPermissionsKey/) immediately, despite the [run_time_permissions](/events/run_time_permissions/) event being queued, or dropped if the object's event queue is full.
- Permission request dialogs never time out.
- If a script makes two permission requests, whichever response is last is considered the granted permissions.
- The viewer limits permission requests from any agent to any other agent to 5 dialogs in 10 seconds.
- Permission requests and changing state ...
  - Requesting a permission in one state, then changing state before the agent response, will cause [run_time_permissions](/events/run_time_permissions/) to be fired in the new state once the agent responds.
  - Requesting only auto-granted permissions in one state, then immediately changing state, will never fire [run_time_permissions](/events/run_time_permissions/).

## Examples

<details open>
<summary>Request permission to animate an avatar</summary>

```lsl collapse={8-21}
default
{
    touch_start(integer detected)
    {
        llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
    }
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llStartAnimation("sit");
            llOwnerSay("animation will end in 5 seconds");
            llSetTimerEvent(5.0);
        }
    }
    timer()
    {
        llSetTimerEvent(0.0);
        llStopAnimation("sit");
    }
}
```

</details>

<details>
<summary>To request two (or more) permissions at the same time, use the bitwise OR (|) [operator](https://wiki.secondlife.com/wiki/LSL_Operators).</summary>

```lsl
llRequestPermissions(AvatarID, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION);
```

</details>

<details>
<summary>: - or -</summary>

```lsl
integer perms = PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION;
llRequestPermissions(AvatarID, perms);
```

</details>

## Notes

When an agent grants a script non-automatic permissions they will receive a notification (in chat) of

- The **name** of the object that contains the script that has been granted perms,
- The name of the owner of the object,
- The location of the object in the order Region name at **position**, and
- A statement of what permissions were granted.

If the script that holds the permissions is in a child prim the **name** will be that of the child prim (not the object (root)) and **position** will be its [local](/functions/llGetLocalPos/) position (relative to its root).

## Known issues

From the issue templates included by the wiki article:

- SVC-1006 (bug): Unable to release script permissions
- SVC-8067 (nf): Improved Permissions Handling

## See also

### Functions

- [llGetPermissions](/functions/llGetPermissions/) — Get the permissions granted
- [llGetPermissionsKey](/functions/llGetPermissionsKey/) — Get the avatar who granted permissions.

### Events

- [run_time_permissions](/events/run_time_permissions/) — Permission receiver event

### Articles

- [Script permissions](https://wiki.secondlife.com/wiki/Category:LSL_Permissions/Script)

---

*Source: [LlRequestPermissions](https://wiki.secondlife.com/wiki/LlRequestPermissions) on the Second Life Wiki. Content from the Second Life Wiki articles LlRequestPermissions (revision 1210161, 2021-08-03), Template:LSL Constants/Permissions (revision 1219061, 2026-09-16), Template:Issues/SVC-1006 (revision 240542, 2009-02-16), Template:Issues/SVC-8067 (revision 1170734, 2012-07-19) and Template:LSL Function/avatar (revision 1179236, 2013-06-15), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llRequestPermissions/
