# llGetObjectPermMask

*LSL function*

```lsl
integer integer llGetObjectPermMask(integer group);
```

- `integer group`: MASK_* group (e.g., MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT) to get.

- Returns: `integer`
- Energy: 10

Returns an [integer](https://wiki.secondlife.com/wiki/integer) of the requested permission `category` for the object containing this script.

```lsl title="How to use" frame="terminal"
integer result = llGetObjectPermMask(0);
```

## Specification

<table>
	<tr>
		<td>

			| `category` |  | Description |
			| --- | --- | --- |
			| [MASK_BASE](/constants/MASK_BASE/) | 0 | The base permissions. |
			| [MASK_OWNER](/constants/MASK_OWNER/) | 1 | Current owner permissions. |
			| [MASK_GROUP](/constants/MASK_GROUP/) | 2 | Active group permissions. |
			| [MASK_EVERYONE](/constants/MASK_EVERYONE/) | 3 | Permissions everyone has. |
			| [MASK_NEXT](/constants/MASK_NEXT/) | 4 | Permissions the next owner will have. |
			| [MASK_COMBINED](/constants/MASK_COMBINED/) | 16 | Include object inventory contents when calculating perms.<br /> Combine with other mask flags, for instance [MASK_OWNER](/constants/MASK_OWNER/)\|[MASK_COMBINED](/constants/MASK_COMBINED/) |

		</td>
		<td>

			| Permissions | Value | Description |
			| --- | --- | --- |
			| [PERM_ALL](/constants/PERM_ALL/) | 0x7FFFFFFF | Move/Modify/Copy/Transfer permissions |
			| [PERM_COPY](/constants/PERM_COPY/) | 0x00008000 | Copy permission |
			| [PERM_MODIFY](/constants/PERM_MODIFY/) | 0x00004000 | Modify permission |
			| [PERM_MOVE](/constants/PERM_MOVE/) | 0x00080000 | Move permission |
			| [PERM_TRANSFER](/constants/PERM_TRANSFER/) | 0x00002000 | Transfer permission |

		</td>
	</tr>
</table>

## Examples

<details open>
<summary>Example 1</summary>

```lsl
if ((permsYouHave & permsYouWant) == permsYouWant)
    llSay(0, "You have the perms you want.");
else
    llSay(0, "You don't have the perms you want.");
```

</details>

<details>
<summary>Example 2</summary>

```lsl
integer ownerPerms = llGetObjectPermMask(MASK_OWNER);
integer copyAndModPerms = PERM_COPY | PERM_MODIFY;

if ((ownerPerms & copyAndModPerms) == copyAndModPerms)
    llSay(0, "Owner has copy & modify perms.");
else
    llSay(0, "Owner does not have copy & modify perms.");
```

</details>

<details>
<summary>Example 3</summary>

```lsl collapse={1-58, 68-73}
string getPermsAsReadableString(integer perm)
{
    integer allPerms = PERM_ALL;
    integer fullPerms = PERM_COPY | PERM_MODIFY | PERM_TRANSFER;

    integer copyModMovePerms = PERM_COPY | PERM_MODIFY | PERM_MOVE;
    integer copyModPerms = PERM_COPY | PERM_MODIFY;

    integer copyTransMovePerms = PERM_COPY | PERM_TRANSFER | PERM_MOVE;
    integer copyTransPerms = PERM_COPY | PERM_TRANSFER;

    integer modTransMovePerms = PERM_MODIFY | PERM_TRANSFER | PERM_MOVE;
    integer modTransPerms = PERM_MODIFY | PERM_TRANSFER;

    integer copyMovePerms = PERM_COPY | PERM_MOVE;

    integer transMovePerms = PERM_TRANSFER | PERM_MOVE;

    string output = " perms: ";

    if ((perm & allPerms) == allPerms)
        output += "full and move";
    else if ((perm & fullPerms) == fullPerms)
        output += "full";
    else if ((perm & copyModMovePerms) == copyModMovePerms)
        output += "copy & modify & move";
    else if ((perm & copyModPerms) == copyModPerms)
        output += "copy & modify";
    else if ((perm & copyTransMovePerms) == copyTransMovePerms)
        output += "copy & transfer & move";
    else if ((perm & copyTransPerms) == copyTransPerms)
        output += "copy & transfer";
    else if ((perm & modTransMovePerms) == modTransMovePerms)
        output += "modify & transfer & move";
    else if ((perm & modTransPerms) == modTransPerms)
        output += "modify & transfer";
    else if ((perm & copyMovePerms) == copyMovePerms)
        output += "copy & move";
    else if ((perm & PERM_COPY) == PERM_COPY)
        output += "copy";
    else if ((perm & transMovePerms) == transMovePerms)
        output += "transfer & move";
    else if ((perm & PERM_TRANSFER) == PERM_TRANSFER)
        output += "transfer";
    else if ((perm & PERM_MOVE) == PERM_MOVE)
        output += "move";
    else
        output += "none";

    //  Remember, items in Second Life must have either
    //  PERM_COPY or PERM_TRANSFER when "talking about"
    //  owner perms or perms for next owner.

    return
        output;
}
default
{
    state_entry()
    {
        integer basePerms      = llGetObjectPermMask(MASK_BASE);
        integer ownerPerms     = llGetObjectPermMask(MASK_OWNER);
        integer nextOwnerPerms = llGetObjectPermMask(MASK_NEXT);
        integer groupPerms     = llGetObjectPermMask(MASK_GROUP);
        integer everyonePerms  = llGetObjectPermMask(MASK_EVERYONE);

        llSay(0, "base"       + getPermsAsReadableString(basePerms));
        llSay(0, "owner"      + getPermsAsReadableString(ownerPerms));
        llSay(0, "next owner" + getPermsAsReadableString(nextOwnerPerms));
        llSay(0, "group"      + getPermsAsReadableString(groupPerms));
        llSay(0, "everyone"   + getPermsAsReadableString(everyonePerms));
    }
}
```

</details>

<details>
<summary>Example 4</summary>

```lsl
integer isLocked()
{
    return !(llGetObjectPermMask(MASK_OWNER) & PERM_MOVE);
}
```

</details>

## Notes

The perms of a newly created object are often:

Base = [PERM_ALL](/constants/PERM_ALL/)

Owner = [PERM_ALL](/constants/PERM_ALL/)

Next = [PERM_MOVE](/constants/PERM_MOVE/) or [PERM_TRANSFER](/constants/PERM_TRANSFER/)

Group = 0 (none)

Everyone = 0 (none)

## Tests

- [llGetObjectPermMask_Test](https://wiki.secondlife.com/wiki/llGetObjectPermMask_Test)

## See also

### Functions

- [llGetInventoryPermMask](/functions/llGetInventoryPermMask/)

### Articles

- [hex](https://wiki.secondlife.com/wiki/hex)

---

*Source: [LlGetObjectPermMask](https://wiki.secondlife.com/wiki/LlGetObjectPermMask) on the Second Life Wiki. Content from the Second Life Wiki articles LlGetObjectPermMask (revision 1206811, 2018-03-18), Template:LSL Constants/Perm Flags (revision 1214447, 2023-09-04) and Template:LSL Constants Perm Mask (revision 1217825, 2024-12-12), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGetObjectPermMask/
