コード例 #1
0
    public string DACEntryToString()
    {
        string retval = "";

        foreach (KeyValuePair <string, DACEntry> entry in this.dac_dict)
        {
            DACEntry de = entry.Value;
            retval += de.DACToString() + "\n";
        }
        return(retval);
    }
コード例 #2
0
    public void ClearEntry(string user_group_name)
    {
        DACEntry entry = dac_dict[user_group_name];

        entry.Clear();
        string component_name = this.asset.computer.component_name;
        string command        = "removeGroup";

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

        IPCManagerScript.SendRequest(xml.ToString());
    }
コード例 #3
0
    public void SetAccess(string name_mode_list)
    {
        StringReader reader = new StringReader(name_mode_list);
        string       line   = null;

        do
        {
            line = reader.ReadLine();
            if (line == null)
            {
                continue;
            }
            //Debug.Log("SetAccess got line " + line);
            string[] parts = line.Split(new char[0], StringSplitOptions.RemoveEmptyEntries);
            //string[] parts = (string []) Regex.Split(line, @"\s+").Where(s => s != string.Empty);

            string   user  = parts[0].Trim();
            string   modes = parts[1].Trim();
            DACEntry entry = new DACEntry(user, modes);
            dac_dict.Add(user, entry);
        } while (line != null);
        //Debug.Log("out of loop");
    }
コード例 #4
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;
    }