Difference between revisions of "LlGetObjectPermMask"

From Second Life Wiki
Jump to navigation Jump to search
m (removed second example script)
m (added PERM_MOVE)
Line 21: Line 21:


     if ((perm & fullPerms) == fullPerms)
     if ((perm & fullPerms) == fullPerms)
         output += "full permissions";
         output += "full";
     else if ((perm & copyModPerms) == copyModPerms)
     else if ((perm & copyModPerms) == copyModPerms)
         output += "copy & modify permissions";
         output += "copy & modify";
     else if ((perm & copyTransPerms) == copyTransPerms)
     else if ((perm & copyTransPerms) == copyTransPerms)
         output += "copy & transfer permissions";
         output += "copy & transfer";
     else if ((perm & modTransPerms) == modTransPerms)
     else if ((perm & modTransPerms) == modTransPerms)
         output += "modify & transfer permissions";
         output += "modify & transfer";
     else if ((perm & PERM_COPY) == PERM_COPY)
     else if ((perm & PERM_COPY) == PERM_COPY)
         output += "copy permissions";
         output += "copy";
     else if ((perm & PERM_TRANSFER) == PERM_TRANSFER)
     else if ((perm & PERM_TRANSFER) == PERM_TRANSFER)
         output += "transfer permissions";
         output += "transfer";


     //  remember, neither PERM_MODIFY only nor no perms at all is possible
     //  remember, neither PERM_MODIFY only nor no perms at all is possible
     //  items in Second Life either have PERM_COPY or PERM_TRANSFER at least
     //  items in Second Life either have PERM_COPY or PERM_TRANSFER at least
    if ((perm & PERM_MOVE) == PERM_MOVE) output += " and move";


     return
     return
Line 57: Line 59:
         llSay(PUBLIC_CHANNEL, "group" + getPermsAsReadableString(groupPerms));
         llSay(PUBLIC_CHANNEL, "group" + getPermsAsReadableString(groupPerms));
         llSay(PUBLIC_CHANNEL, "everyone" + getPermsAsReadableString(everyonePerms));
         llSay(PUBLIC_CHANNEL, "everyone" + getPermsAsReadableString(everyonePerms));
    //  remove this script after having spammed local chat with info
        llRemoveInventory(llGetScriptName());
     }
     }
}
}

Revision as of 11:41, 25 November 2012

Summary

Function: integer llGetObjectPermMask( integer mask );

Returns an integer that is the requested permission mask for the root object the task is attached to.

• integer mask MASK_* flag

Category Description
MASK_BASE 0 The base permissions.
MASK_OWNER 1 Current owner permissions.
MASK_GROUP 2 Active group permissions.
MASK_EVERYONE 3 Permissions everyone has.
MASK_NEXT 4 Permissions the next owner will have.
Permissions Value Description
PERM_ALL 0x7FFFFFFF Move/Modify/Copy/Transfer permissions
PERM_COPY 0x00008000 Copy permission
PERM_MODIFY 0x00004000 Modify permission
PERM_MOVE 0x00080000 Move permission
PERM_TRANSFER 0x00002000 Transfer permission

Examples

<lsl> string getPermsAsReadableString(integer perm) {

integer fullPerms = PERM_COPY

Notes

The perms of a newly created object often are Base = PERM_ALL, Owner = PERM_ALL, Next = PERM_MOVE or PERM_TRANSFER, Group = 0 (none), Everyone = 0 (none). The perms2String example describes those perms as "Closed / Yes Transfer".

See Also

Functions

•  llGetInventoryPermMask

Articles

•  hex

Deep Notes

Search JIRA for related Issues

Tests

•  llGetObjectPermMask_Test

Signature

function integer llGetObjectPermMask( integer mask );