LSL Wiki Mirror 10-5-2006: llRequestPermissions

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
llRequestPermissions(key agent, integer perm)

Ask agent to allow the script to do perm, which can be any of the following constants joined together through bitwise OR (|).

Constant Result Allows
PERMISSION_DEBIT Requests permission to take money from agent's account. use of llGiveMoney
PERMISSION_TAKE_CONTROLS Request permission to take agent's controls. use of llTakeControls and llReleaseControls
PERMISSION_TRIGGER_ANIMATION Requests permission to trigger animation on agent. use of llStartAnimation and llStopAnimation
PERMISSION_ATTACH Requests permission to attach/detach from agent. use of llAttachToAvatar and llDetachFromAvatar
PERMISSION_CHANGE_LINKS Requests permission to change links. use of llCreateLink, llBreakLink, and llBreakAllLinks
PERMISSION_TRACK_CAMERA Permission to track the agent's camera position and rotation Use of llGetCameraPos and llGetCameraRot
PERMISSION_CONTROL_CAMERA Permission to control the agent's camera position and rotation Use of llSetCameraParams and llClearCameraParams

Requests for the PERMISSION_DEBIT and PERMISSION_CHANGE_LINKS constants can only go to the object's owner. Requests for all other permissions can go to any agent.

Invokes the run_time_permissions event when agent accepts or rejects the requested permissions.

Be aware that the effects of this call are not additive. This means that all desired permissions must be requested for any call because the new permissions (or lack thereof) will completely replace the old permissions. Requesting permission FALSE (or 0) will result in all permissions being released.

Further, multiple agents may not grant permissions to the same script at the same time. For an object to have permissions for multiple agents simultaneously, one script is needed for each agent. They may still be within the same prim, however.

As of 1.10.5.1, PERMISSION_CONTROL_CAMERA will not be granted in combination with either of PERMISSION_CHANGE_LINKS or PERMISSION_DEBIT even to scripts in attached or sat-upon objects, and the call will fail with a misleading error message.

Q: According to the official Linden scripting docs, llRequestPermissions should return an integer. What is returned? Is it the permissions granted, all of the now-available permissions, etc.? Is this integer passed to run_time_permissions?
A: No, this is an error in the official guide. It doesn't return an integer. Trying to capture it results in a compile error. My guess is that the help text is right and this function doesn't return anything.

Q: Looks like there is a max range for the perm request (looks like it always fails from sim to sim), what is it?
A: When requesting all permissions there isn't one (you don't even have to be in the sim but this might be limited to the owner).
A: Permissions for owner may be anywhere, permissions for non-owner agents are limited to the simulator, this is an anti-spam provision. - Ice

Q: If this call fails, because the avatar is offline, or otherwise unable to grant permissions, does it hang, or does it trigger run_time_permissions with the permissions shown as ungranted?
A: run_time_permissions is not triggered.

Q: When requesting permissions from an attachment, permissions are automatically granted if the script requesting them is in the root prim. However, if the script is in a child prim, the user will always see a permissions dialog. Is this supposed to happen or a bug?
A: This is presumably a bug. If you need a script in a child prim, and want the object to be quiet, place a corresponding script in your root prim to request permissions, then use link messages to communicate between the two.

Compare with llGetPermissions and llGetPermissionsKey.

See control for an example.

See FutureRevisions to see the permission flags of the future.


Functions | Agent/Avatar
There is one comment on this page. [Display comments/form]