Don't click here unless you want to be banned.

LSL Wiki : llRequestPermissions

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
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 (|).

Flag Value Result Allows
PERMISSION_DEBIT 2 Requests permission to take money from agent's account. use of llGiveMoney
PERMISSION_TAKE_CONTROLS 4 Request permission to take agent's controls. use of llTakeControls and llReleaseControls
PERMISSION_REMAP_CONTROLS 8 Requests permission to change keys for an agents controls may allow script to modify what the controls do
PERMISSION_TRIGGER_ANIMATION 16 Requests permission to trigger animation on agent. use of llStartAnimation and llStopAnimation
PERMISSION_ATTACH 32 Requests permission to attach/detach from agent. use of llAttachToAvatar and llDetachFromAvatar
PERMISSION_RELEASE_OWNERSHIP 64 ? <Deprecated> releases ownership of the object (The concept of public objects has been removed from SL.)
PERMISSION_CHANGE_LINKS 128 Requests permission to change links. use of llCreateLink, llBreakLink, and llBreakAllLinks
PERMISSION_CHANGE_JOINTS 256 ? <Not implemented yet> change the attachment's joint
PERMISSION_CHANGE_PERMISSIONS 512 ? <Not implemented yet> change permissions without use of llRequestPermissions
PERMISSION_TRACK_CAMERA 1024 Permission to track the agent's camera position and rotation Use of llGetCameraPos and llGetCameraRot
PERMISSION_CONTROL_CAMERA 2048 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 and will not raise the run_time_permissions event handler. (This release functionality is currently broken! See: for more information.)

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.

Permissions are retained over script state changes, taking to inventory and re-rezzing, but are lost on a script reset.

As of, 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: Is the fact that you can't combine PERMISSION_CONTROL_CAMERA and PERMISSION_CHANGE_LINKS together a bug or does it have a purpose?

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. Alternately this is possibly intentional to prevent placing rouge scripts which take some sort of control in child prims where they may be hard to locate.
A: As of server 1.25, attachment child prims should automatically get permissions just like the root.

Compare with llGetPermissions and llGetPermissionsKey.

See control for an example.

See FutureRevisions to see the permission flags of the future.

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Agent/Avatar
There are 3 comments on this page. [Display comments/form]