[sldev] Another Technical question

Carlo Wood carlo at alinoe.com
Sat May 16 10:40:24 PDT 2009


I tried to change the code of my viewer in order to
create new scripts that are full permission by
default. (The reason why I want that is explained
below, but not really relevant).

I changed in llpanelcontents.cpp, in function
LLPanelContents::onClickNewScript, the call

    LLPermissions perm;
    perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);
    perm.initMasks(
	    PERM_ALL,
	    PERM_ALL,
	    PERM_NONE,
	    PERM_NONE,
	    PERM_MOVE | PERM_ITEM_UNRESTRICTED);


Where the "PERM_ITEM_UNRESTRICTED" for the last parameter
(next owner) was changed from PERM_ITEM_TRANSFER.

However... all I get is a script that has ONLY
the 'transfer' permission for next owner set :/.

I can't seem to figure out why those permissions
can't be set here-- or what goes wrong-- or even
how to change this function to do whatever to
set the permissions to another value.

Ie, I looked at what happens if you click on
the permission check boxes, and then added to
the bottom of LLPanelContents::onClickNewScript:

  perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, PERM_ALL);
  new_item->setPermissions(perm);
  object->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, false);

but even that doesn't change the permissions of
the created script!?

Can someone tell me what is going on here?

-- 
Carlo Wood <carlo at alinoe.com>

PS The reason I want this is because I share my build
   objects with someone. We have eachothers build
   permissions, but still need to shift-copy objects
   in order to get access to scripts. Hence, all
   scripts (and everything else) has to be full perm
   while working on it. The problem is that this
   is often *forgotten* with as result lost permissions
   for both.


More information about the SLDev mailing list