LlGetInventoryPermMask Test

From Second Life Wiki
Revision as of 14:23, 16 May 2008 by Cogsworth Linden (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

[LLGetInventoryPermMaskTest]

[VERSION] 0.2

[LENGTH] 01:30

[TESTERS] 2

[OVERVIEW] This test has been designed to test if permissions are transferred correctly between users inventorys. It also tests the functionality of the llGetInventoryPermMask LSL Function.

[SETUP] This test requires 2 users and rezzable land

[*]

[0010] Tester 1: Create 8 simple cubes on the ground, name them "Object1" through "Object8"

[0020] Tester 1: Set the Permissions for each as follows: (not shared with group, not anyone can copy, not anyone can move unless stated)

[0030] full permissions, shared with group, anyone can copy, anyone can move

[0040] full permissions

[0050] no copy

[0060] no mod

[0070] no copy, no mod

[0080] no mod, no transfer

[0090] no transfer

[0100] full permissions, locked

[0110] Tester 1: Create and Add the script to each item. (unlock the locked box and relock it after)

[SCRIPT] llGetInventoryPermMaskScript

[*]

[NOTES] Make sure the script is full permissions for the next user: copyable, modable, transferrable !!!

[*]

[0120] Tester 1: Create 8 folders in your inventory, one for each of the permissions created above

[0130] Tester 1: In each folder, place a copy of one of each item:

"clothing","gesture","image","landmark","note","object","script","shape","sound"

[*]

[NOTES] Make sure each item is new, not an old library object !!!

[*]

[0140] Tester 1: Rename each item in the folders by its type, Example: landmark, note etc, case-sensitive. (You may want to create one set of 8, name them, then copy to the other 7 folders to save time.)

[0150] Tester 1: Change the permissions of each 8 items in each folder appropriate to the permission types being tested above. (In the case of "full permissions, locked", just have each of the items in the folder be full permissions.)

[0160] Tester 1: Drag each folder to its appropriately permissioned object1-8.

[0170] Tester 1: Take a copy of each object1-8 and give each to Tester 2:

[0180] Tester 1: Leave the objects1-8 on the ground in a row to make it easier to test all at once.

[*]

[NOTES] At this point you should have 8 objects on the ground each with 1 of each of 8 different types of items in the Contents, all with permissions set to the types being tested.

[*]

[0190] Tester 2: Accept all objects from Tester 1:

[0200] Tester 2: Rez the items on the ground next to Tester 1's items.

[0210] Tester 2: Close the Edit Window if it is open.

[0220] Tester 2: One at a time, left-click each box to touch it.

[0230] Observe the output for each. Compare the perms reported with the actual perms of the contents.

[0240] Verify all permissions reported match up; on failures, indicate which object and which permissions.

[*]

[NOTES] Output will be grouped by item, then by which mask type, then a 5-digit number corresponding to permissions: PERM_MOVE,PERM_MODIFY,PERM_COPY,PERM_TRANSFER,PERM_ALL

So for example - gesture:owner:10100 means that the owner has PERM_MOVE and PERM_COPY for the gesture in the box.

[*]

[NOTES] (Base permissions are the least restrictive that the object has, owner permissions are what permissions the owner of the object has, group permissions are what permissions the group has, which should only work with shared with group, everyone permissions are what anyone can do, NEXT permissions are what the next owner can do.)

[END]


[llGetInventoryPermMaskScript]

list itemTypes = ["clothing","gesture","image","landmark","note","object","script","shape","sound"]; 
list maskTypes = [MASK_BASE,MASK_OWNER,MASK_GROUP,MASK_EVERYONE,MASK_NEXT]; 
list maskNames = ["base","owner","group","everyone","next"]; 
list permTypes = [PERM_MOVE,PERM_MODIFY,PERM_COPY,PERM_TRANSFER,PERM_ALL]; 

say(string what) 
{ 
llWhisper(0,what); 
} 

doPermIter(integer perm, string which) 
{ 
string output=which+":"; 
integer e; 
for (e=0;e<llGetListLength(permTypes);++e) 
{ 
if(llList2Integer(permTypes,e) & perm) 
output+="1"; 
else 
output+="0"; 
} 
say(output); 
} 

doContentIter(string item) 
{ 
integer d; 
for(d=0;d<llGetListLength(maskTypes);++d) 
{ 
integer theperm = llGetInventoryPermMask(item, llList2Integer(maskTypes,d)); 
doPermIter(theperm,item+":"+llList2String(maskNames,d)); 
} 

} 

default 
{ 
touch_start(integer total_number) 
{ 
if(llDetectedKey(0)==llGetOwner()) 
{ 

say("Beginning llObjectPermMark test!"); 
say("Testing Base Permissions..."); 
string theitem; 
integer c; 
for(c=0;c<llGetListLength(itemTypes);++c) 
{ 
theitem = llList2String(itemTypes,c); 
if(theitem!="") 
doContentIter(theitem); 
else 
say("Item type "+(string)c+" is blank. Skipping test."); 
} 
} // end if key = owner 
} // end touch 
}