Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llGetInventoryPermMask C# (CSharp) Method

llGetInventoryPermMask() public method

public llGetInventoryPermMask ( string item, int mask ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
item string
mask int
return Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
        public LSL_Integer llGetInventoryPermMask(string item, int mask)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0;


            lock (m_host.TaskInventory)
            {
                foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
                {
                    if (inv.Value.Name == item)
                    {
                        switch (mask)
                        {
                            case 0:
                                return (int)inv.Value.BasePermissions;
                            case 1:
                                return (int)inv.Value.CurrentPermissions;
                            case 2:
                                return (int)inv.Value.GroupPermissions;
                            case 3:
                                return (int)inv.Value.EveryonePermissions;
                            case 4:
                                return (int)inv.Value.NextPermissions;
                        }
                    }
                }
            }

            return -1;
        }
LSL_Api