llRequestPermissions(key agent, integer perm)
to allow the script
to do perm
, which can be any of the following constants
joined together through bitwise OR (|)
Requests for the PERMISSION_DEBIT
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
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
) will result in all
permissions being released and will not
raise the run_time_permissions
event handler. (This release functionality is currently broken! See: https://jira.secondlife.com/browse/SVC-1006 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 184.108.40.206, PERMISSION_CONTROL_CAMERA
will not be granted in combination with either of PERMISSION_CHANGE_LINKS
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
for an example.
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.