Beispiel #1
0
        public bool SaveSetting(IPermissionSet setting)
        {
            ForumPermissionSetNodeCollection tempNodes = new ForumPermissionSetNodeCollection();

            bool haveAdd = false;

            foreach (ForumPermissionSetNode node in Nodes)
            {
                if (node.NodeID == setting.NodeID)
                {
                    tempNodes.Add((ForumPermissionSetNode)setting);
                    haveAdd = true;
                }
                else
                {
                    tempNodes.Add(node);
                }
            }

            if (haveAdd == false)
            {
                tempNodes.Add((ForumPermissionSetNode)setting);
            }

            ForumPermissionSet permissionSet = new ForumPermissionSet();

            permissionSet.Nodes = tempNodes;

            return(SettingManager.SaveSettings(permissionSet));
        }
Beispiel #2
0
        public ForumPermissionSet()
        {
            Nodes = new ForumPermissionSetNodeCollection();
            ForumPermissionSetNode topNode = new ForumPermissionSetNode();

            Nodes.Add(topNode);
        }
Beispiel #3
0
        public bool DeleteSetting(int nodeID)
        {
            if (nodeID == 0)
            {
                return(true);
            }

            ForumPermissionSetNodeCollection tempNodes = new ForumPermissionSetNodeCollection();

            foreach (ForumPermissionSetNode node in Nodes)
            {
                if (node.NodeID != nodeID)
                {
                    tempNodes.Add(node);
                }
            }

            ForumPermissionSet permissionSet = new ForumPermissionSet();

            permissionSet.Nodes = tempNodes;

            return(SettingManager.SaveSettings(permissionSet));
        }