Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

why does llDetachFromAvatar need permission?

Adrian Zobel
Registered User
Join date: 4 Jan 2006
Posts: 49
03-27-2006 06:33
I have an attachment that listens for commands, and when it hears the detach command it detaches itself.

Just issuing llDetachFromAvatar() doesn't work because it doesn't have PERMISSION_ATTACH. But that seems odd... if the object didn't have attach permission it wouldn't be attached, would it? And then the script wouldn't be running anyway.

Fortunately my script is in the root prim, so I can just do

llRequestPermissions( llGetOwner(), PERMISSION_ATTACH );
llDetachFromAvatar();

and there is no dialog box, no message to the owner, apparently it doesn't even delay the script. But that begs the same question... if it's so automatic, why doesn't llDetachFromAvatar just assume permission itself, and work regardless?
Jamie Marlin
Ought to be working....
Join date: 13 May 2005
Posts: 43
Automatic Permissions
03-27-2006 13:24
Adrian-

When you attach something, you automatically grant certain permissions (PERMISSION_ANIMATE, PERMISSION_TAKE_CONTROLS, PERMISSION_ATTACH... there may be others, but that is the list that comes to mind). The LSL commands that require permissions are all based on Linden seeing some way that the command could be misused and adding permissions to prevent the abuse. I am not certain what the specific exploit they were trying to block here was - perhaps a scripted gun that causes a target's attachments to fall off?

At any rate... Linden added an automatic grant of permissions when you choose to attach an object, so in many cases you never see the "request permissions..." dialog box. You do have to jump thru the hoop and request permissions first.
Adrian Zobel
Registered User
Join date: 4 Jan 2006
Posts: 49
03-27-2006 14:50
Well, it seems like it *should* automatically grant certain permissions when you attach something. But it doesn't. A call to llGetPermissions() in an object I attach returns 0... until after I do some sort of llRequestPermissions.

Any sort of gun that would want to do this would simply add the line that I listed and since it succeeds automatically, it can't possibly prevent any sort of abuse.
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
03-27-2006 15:17
by automatically grant what was meant was you still llRequestPermissions, but they don't even get the dialog (again only for certain permissions, for example I'm pretty sure they'll still get the dialog for PERMISSION_DEBIT).

edit: rephrase . . . what it actually does it automatically says yes instead of giving the dialog to the owner. You still have to ask for them though.