Don't click here unless you want to be banned.

LSL Wiki : llGetInventoryPermMask

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl423.us.archive.org
integer llGetInventoryPermMask(string item, integer mask)

Returns the requested permission mask for the inventory item defined by item. If item is not in the object's inventory, llGetInventoryPermMask returns 0 and causes the object to say "No item named '<item>'", where "<item>" is item. If this is used to determine whether or not an inventory item exists within the object, it will have the side effect of spamming chat.

To determine the existence of an item in the inventory without spamming chat, use llGetInventoryType.

Base permissions are the permissions the object has when it was given to the current owner. In theory, no other mask can have more permissions than the base. If they do then this is a bug in permissions and should be reported.

Mask Value Description
MASK_BASE 0 Get the object's base permissions
MASK_OWNER 1 Get the permissions the current owner has.
MASK_GROUP 2 Get the permissions the object's active group has.
MASK_EVERYONE 3 Get the permissions everyone has on the object.
MASK_NEXT 4 Get the permissions the next owner has.
These are not bit flags. They cannot be OR'ed.

Permissions Value (hex) Value (integer) Description
PERM_ALL 0x7FFFFFFF 2147483647 Move/Modify/Copy/Transfer permissions
PERM_COPY 0x00008000 32768 Copy permission
PERM_MODIFY 0x00004000 16384 Modify permission
PERM_MOVE 0x00080000 524288 Move permission
PERM_TRANSFER 0x00002000 8192 Transfer permission
Do note that ((PERM_COPY | PERM_MODIFY | PERM_MOVE | PERM_TRANSFER) is not the same as PERM_ALL). This is because there may (read as: will) be more permissions in the future.

Compare with llGetObjectPermMask.

Q: How do I set perm masks?
A: As of SL 1.6.1, you can't. There's a function to do so, llSetInventoryPermMask, but it hasn't been completed for security reasons. At some point, it will probably be completed, but there has been no word on when that might happen.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Inventory | Permissions | Asset Permissions
Comments [Hide comments/form]
This seems to work fine as of SL 1.15.0 (2)
string PermStr(integer Perm)
{
string PermString;
if (Perm & PERM_MODIFY)
{
PermString += "(Modify)";
} else {
PermString += "(No Modify)";
}

if (Perm & PERM_COPY)
{
PermString += "(Copy)";
} else {
PermString += "(No Copy)";
}

if (Perm & PERM_TRANSFER)
{
PermString += "(Transfer)";
} else {
PermString += "(No Transfer)";
}
return PermString;
}



default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}

touch_start(integer total_number)
{
integer i = 0;
integer Count = llGetInventoryNumber(INVENTORY_ALL);
do
{
string Name = llGetInventoryName(INVENTORY_ALL, i);
integer Perms = llGetInventoryPermMask(Name, MASK_OWNER);
llSay(0, Name + " " + PermStr(Perms));
} while (++i < Count);
}
}
-- RyozuKojima (2007-05-01 17:24:41)
Attach a comment to this page: