Example #1
0
        private void GetNodeCommentSelectPermission()
        {
            string        selectId   = "";
            StringBuilder roleIdList = new StringBuilder();
            StringBuilder builder2   = new StringBuilder();
            StringBuilder builder3   = new StringBuilder();

            this.m_ChkNodeCommentReplyAll  = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkNodeCommentReply")).Checked;
            this.m_ChkNodeCommentCheckAll  = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkNodeCommentCheck")).Checked;
            this.m_ChkNodeCommentManageAll = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkNodeCommentManage")).Checked;
            for (int i = 0; i < this.EgvNodes.Rows.Count; i++)
            {
                this.m_ChkNodeCommentReply  = (CheckBox)this.EgvNodes.Rows[i].Cells[2].FindControl("ChkNodeCommentReply");
                this.m_ChkNodeCommentCheck  = (CheckBox)this.EgvNodes.Rows[i].Cells[3].FindControl("ChkNodeCommentCheck");
                this.m_ChkNodeCommentManage = (CheckBox)this.EgvNodes.Rows[i].Cells[4].FindControl("ChkNodeCommentManage");
                selectId = this.EgvNodes.DataKeys[i].Value.ToString();
                AppendSelectId(this.m_ChkNodeCommentReply.Checked || this.m_ChkNodeCommentReplyAll, selectId, ref roleIdList);
                AppendSelectId(this.m_ChkNodeCommentCheck.Checked || this.m_ChkNodeCommentCheckAll, selectId, ref builder2);
                AppendSelectId(this.m_ChkNodeCommentManage.Checked || this.m_ChkNodeCommentManageAll, selectId, ref builder3);
            }
            AppendAllId(roleIdList, this.EgvNodes.Rows.Count - 1);
            AppendAllId(builder2, this.EgvNodes.Rows.Count - 1);
            AppendAllId(builder3, this.EgvNodes.Rows.Count - 1);
            RolePermissions.DeleteNodePermissionFromRoles(this.m_RoleId, -2, OperateCode.NodeCommentReply);
            RolePermissions.DeleteNodePermissionFromRoles(this.m_RoleId, -2, OperateCode.NodeCommentCheck);
            RolePermissions.DeleteNodePermissionFromRoles(this.m_RoleId, -2, OperateCode.NodeCommentManage);
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.NodeCommentReply, roleIdList.ToString());
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.NodeCommentCheck, builder2.ToString());
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.NodeCommentManage, builder3.ToString());
        }
        private void InputRolePermission(int nodeId)
        {
            StringBuilder roleIdList = new StringBuilder();
            StringBuilder builder2   = new StringBuilder();
            StringBuilder builder3   = new StringBuilder();
            StringBuilder builder4   = new StringBuilder();
            StringBuilder builder5   = new StringBuilder();
            StringBuilder builder6   = new StringBuilder();

            for (int i = 0; i < this.EgvRoleView.Rows.Count; i++)
            {
                CheckBox box      = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkNodePreview");
                CheckBox box2     = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkNodeInput");
                CheckBox box3     = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkNodeCheck");
                CheckBox box4     = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkContentManage");
                CheckBox box5     = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkNodeManage");
                CheckBox box6     = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkCommentManage");
                string   selectId = this.EgvRoleView.DataKeys[i].Value.ToString();
                AppendSelectId(box.Checked, roleIdList, selectId);
                AppendSelectId(box2.Checked, builder2, selectId);
                AppendSelectId(box3.Checked, builder3, selectId);
                AppendSelectId(box4.Checked, builder4, selectId);
                AppendSelectId(box5.Checked, builder5, selectId);
                AppendSelectId(box6.Checked, builder6, selectId);
            }
            RolePermissions.DeleteNodePermissionFromRoles(-1, nodeId);
            RolePermissions.AddNodePermissionToRoles(roleIdList.ToString(), nodeId, OperateCode.NodeContentPreview);
            RolePermissions.AddNodePermissionToRoles(builder2.ToString(), nodeId, OperateCode.NodeContentInput);
            RolePermissions.AddNodePermissionToRoles(builder3.ToString(), nodeId, OperateCode.NodeContentCheck);
            RolePermissions.AddNodePermissionToRoles(builder5.ToString(), nodeId, OperateCode.ChildNodesManage);
            RolePermissions.AddNodePermissionToRoles(builder4.ToString(), nodeId, OperateCode.NodeContentManage);
            RolePermissions.AddNodePermissionToRoles(builder6.ToString(), nodeId, OperateCode.NodeCommentManage);
        }
Example #3
0
        private void GetContentNodeSelectPermission()
        {
            string        selectId   = "";
            StringBuilder roleIdList = new StringBuilder();
            StringBuilder builder2   = new StringBuilder();
            StringBuilder builder3   = new StringBuilder();
            StringBuilder builder4   = new StringBuilder();

            this.m_NodePreviewAll   = ((CheckBox)this.EgvContents.Rows[0].FindControl("ChkNodePreview")).Checked;
            this.m_NodeInputAll     = ((CheckBox)this.EgvContents.Rows[0].FindControl("ChkNodeInput")).Checked;
            this.m_NodeCheckAll     = ((CheckBox)this.EgvContents.Rows[0].FindControl("ChkNodeCheck")).Checked;
            this.m_ContentManageAll = ((CheckBox)this.EgvContents.Rows[0].FindControl("ChkContentManage")).Checked;
            for (int i = 0; i < this.EgvContents.Rows.Count; i++)
            {
                this.m_ChkNodePreview   = (CheckBox)this.EgvContents.Rows[i].Cells[2].FindControl("ChkNodePreview");
                this.m_ChkNodeInput     = (CheckBox)this.EgvContents.Rows[i].Cells[3].FindControl("ChkNodeInput");
                this.m_ChkNodeCheck     = (CheckBox)this.EgvContents.Rows[i].Cells[4].FindControl("ChkNodeCheck");
                this.m_ChkContentManage = (CheckBox)this.EgvContents.Rows[i].Cells[5].FindControl("ChkContentManage");
                selectId = this.EgvContents.DataKeys[i].Value.ToString();
                AppendSelectId(this.m_ChkNodePreview.Checked || this.m_NodePreviewAll, selectId, ref roleIdList);
                AppendSelectId(this.m_ChkNodeInput.Checked || this.m_NodeInputAll, selectId, ref builder2);
                AppendSelectId(this.m_ChkNodeCheck.Checked || this.m_NodeCheckAll, selectId, ref builder3);
                AppendSelectId(this.m_ChkContentManage.Checked || this.m_ContentManageAll, selectId, ref builder4);
            }
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.NodeContentPreview, roleIdList.ToString());
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.NodeContentInput, builder2.ToString());
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.NodeContentCheck, builder3.ToString());
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.NodeContentManage, builder4.ToString());
        }
Example #4
0
        public static int GetNodeByIdCopyNode(int nodeId)
        {
            int maxNodeId = 0;

            if (nodeId > 0)
            {
                NodeInfo nodeById = GetNodeById(nodeId);
                nodeById.NodeName       = StringHelper.CopyString(nodeById.NodeName);
                nodeById.NodeIdentifier = StringHelper.CopyStringNum(nodeById.NodeIdentifier);
                nodeById.NodeDir        = StringHelper.CopyStringNum(nodeById.NodeDir);
                while (ExistsNodeNameTwo(nodeById.ParentId, nodeById.NodeName))
                {
                    nodeById.NodeName = StringHelper.CopyString(nodeById.NodeName);
                }
                while (ExistsNodeIdentifier(nodeById.ParentId, nodeById.NodeIdentifier))
                {
                    nodeById.NodeIdentifier = StringHelper.CopyStringNum(nodeById.NodeIdentifier);
                }
                while (ExistsNodeDir(nodeById.ParentId, nodeById.NodeDir))
                {
                    nodeById.NodeDir = StringHelper.CopyStringNum(nodeById.NodeDir);
                }
                if (Add(nodeById) != 1)
                {
                    return(maxNodeId);
                }
                maxNodeId = GetMaxNodeId();
                foreach (NodesModelTemplateRelationShipInfo info2 in ModelManager.GetNodesModelTemplateList(nodeId))
                {
                    info2.NodeId = maxNodeId;
                    if (!ModelManager.ExistsNodesModelTemplateRelationShip(info2) && !ModelManager.AddNodesModelTemplateRelationShip(info2))
                    {
                        maxNodeId = -1;
                    }
                }
                if (PEContext.Current.Admin.IsSuperAdmin)
                {
                    return(maxNodeId);
                }
                foreach (RoleNodePermissionsInfo info3 in RolePermissions.GetNodePermissionsByNodeId(nodeId))
                {
                    info3.NodeId = maxNodeId;
                    RolePermissions.AddNodePermissionToRoles(info3.GroupId, info3.NodeId, info3.OperateCode);
                }
            }
            return(maxNodeId);
        }
Example #5
0
        private void GetNodeSelectPermission()
        {
            StringBuilder roleIdList = new StringBuilder();
            StringBuilder builder2   = new StringBuilder();
            string        selectId   = "";

            this.m_CurrentNodesManageAll = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkCurrentNodesManage")).Checked;
            this.m_ChildNodeManageAll    = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkChildNodeManage")).Checked;
            for (int i = 0; i < this.EgvNodes.Rows.Count; i++)
            {
                this.m_ChkCurrentNodesManage = (CheckBox)this.EgvNodes.Rows[i].Cells[2].FindControl("ChkCurrentNodesManage");
                this.m_ChildNodeManage       = (CheckBox)this.EgvNodes.Rows[i].Cells[3].FindControl("ChkChildNodeManage");
                selectId = this.EgvNodes.DataKeys[i].Value.ToString();
                AppendSelectId(this.m_ChkCurrentNodesManage.Checked || this.m_CurrentNodesManageAll, selectId, ref roleIdList);
                AppendSelectId(this.m_ChildNodeManage.Checked || this.m_ChildNodeManageAll, selectId, ref builder2);
            }
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.CurrentNodesManage, roleIdList.ToString());
            RolePermissions.AddNodePermissionToRoles(this.m_RoleId, OperateCode.ChildNodesManage, builder2.ToString());
        }