run_time_permissions(integer perm)
This
event is invoked either after the
user has responded to a
permission request or if permissions granted to the
script have changed. The
integer perm value returned to this event contains the current set of permissions
flags so, if
perm == 0, then no permissions are set.
A script needs permission from either its
owner or the
agent it is to act on before it performs certain
functions, such as debiting
money from its owner's account, triggering an
animation on an agent, capturing
control inputs, etc.
llRequestPermissions is used to request these permissions and the various permissions integer
constants can be supplied:
perm Value | Value | Action | Granter |
PERMISSION_DEBIT | 2 | permission to take money from agent's account | owner |
PERMISSION_TAKE_CONTROLS | 4 | permission to take agent's controls | anyone |
PERMISSION_TRIGGER_ANIMATION | 16 | permission to trigger animation on agent | anyone |
PERMISSION_ATTACH | 32 | permission to attach/detach from agent | owner |
PERMISSION_CHANGE_LINKS | 128 | permission to change links | owner |
PERMISSION_TRACK_CAMERA | 1024 | permission to follow camera movement | anyone |
PERMISSION_CONTROL_CAMERA | 2048 | permission to use llSetCameraParams | anyone |
See
FutureRevisions for future additions to
perm.
Note: permission requests do not always ask the user for permission directly. In case of the agent
sitting on or
attaching a scripted
object,
PERMISSION_TRIGGER_ANIMATION and
PERMISSION_TAKE_CONTROLS will always be granted automatically. However, they still need to be requested within the script.
See
control for an example.
Q: I see that this function takes an integer bitfield value for perm, but I see that values 1, 8, and 64 are not listed. Any ideas of what these were, are, or will be used for?
A: See FutureRevisions.
Q: Can I ask for permissions that don't have a constant or an unimplemented constant? Can the user grant them?
A: Yes they can be requested and granted; they just won't do anything. See the table below for restrictions.
perm Value | Value | Future Expected Use | Granter |
unknown | 1 | unknown | anyone |
PERMISSION_REMAP_CONTROLS | 8 | permission to remap agent's controls | anyone |
PERMISSION_RELEASE_OWNERSHIP | 64 | (deprecated) permission to release ownership (The concept of public objects has been removed from SL.) | owner |
PERMISSION_CHANGE_JOINTS | 256 | permission to change joints | owner |
PERMISSION_CHANGE_PERMISSIONS | 512 | permission to change permissions | owner |
Events |
Agent/Avatar