public void ACLClicked()
    {
        string asset_name = this.asset_dropdown.captionText.text;

        Debug.Log("ACL clicked, current asset is <" + asset_name + ">");
        AssetBehavior asset_script = AssetBehavior.asset_dict[asset_name];
        string        dac_string   = asset_script.GetDACString();

        Debug.Log(dac_string);
        GameObject acl_panel = menus.menu_panels["ACLPanel"];

        acl_panel.SetActive(true);
        ACLConfigure acl_script = (ACLConfigure)acl_panel.GetComponent(typeof(ACLConfigure));

        acl_script.SetDAC(asset_script.GetDACAccess());
        //menus.clicked = "Component:" + current_computer.component_name + ":Configure:ACL:" + asset_name;
    }
Esempio n. 2
0
    public void ACLChanged(string user_group_name, Dropdown dd, ACLConfigure config)
    {
        if (this.supress_value_change_hack)
        {
            return;
        }
        this.supress_value_change_hack = true;
        Debug.Log("ACL Changed for " + dd.name + " new mode select " + dd.captionText.text);
        char     option     = option_map[dd.captionText.text];
        DACEntry entry      = dac_dict[user_group_name];
        char     was_option = 'z';

        switch (dd.name)
        {
        case "ReadDropdown":
            was_option = entry.read;
            entry.read = option;
            break;

        case "WriteDropdown":
            was_option  = entry.write;
            entry.write = option;
            break;

        case "ControlDropdown":
            was_option    = entry.control;
            entry.control = option;
            break;

        case "ExecuteDropdown":
            was_option    = entry.execute;
            entry.execute = option;
            break;
        }
        Debug.Log("ACLChanged, was option " + was_option);
        if (was_option == '-')
        {
            Debug.Log("now call CheckDefault");
            config.CheckDefault(dd, option);
        }
        entry.read    = option_map[config.read_dropdown.captionText.text];
        entry.write   = option_map[config.write_dropdown.captionText.text];
        entry.control = option_map[config.control_dropdown.captionText.text];
        entry.execute = option_map[config.execute_dropdown.captionText.text];
        int    mode           = entry.GetMode();
        string component_name = this.asset.computer.component_name;
        string command        = "changeGroupMask";
        string name_string    = "groupName";

        if (UserBehavior.user_dict.ContainsKey(user_group_name))
        {
            command     = "changeUserMask";
            name_string = "userName";
        }
        XElement xml = new XElement("componentEvent",
                                    new XElement("name", component_name),
                                    new XElement("assetACL",
                                                 new XElement("assetName", this.asset.asset_name),
                                                 new XElement(command,
                                                              new XElement(name_string, user_group_name),
                                                              new XElement("mode", mode))));

        IPCManagerScript.SendRequest(xml.ToString()); this.supress_value_change_hack = false;
    }