Beispiel #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);
        }
Beispiel #3
0
 private static void DeleteNodeRelationByNodeId(int nodeId)
 {
     RolePermissions.DeleteNodePermissionFromRoles(-1, nodeId);
     UserPermissions.DeleteNodePermissionsByNodeId(nodeId, OperateCode.None);
     ModelManager.DeleteNodeModel(nodeId);
     ModelManager.DeleteNodeTemplateId(nodeId);
     ModelManager.DeleteNodesModelTemplateRelationShip(nodeId);
 }
Beispiel #4
0
 public void InputPermissions()
 {
     if (this.m_RoleId != 0)
     {
         RolePermissions.DeleteNodePermissionFromRoles(this.m_RoleId, -2);
         this.GetContentNodeSelectPermission();
         this.GetNodeSelectPermission();
         this.GetNodeCommentSelectPermission();
         this.GetSpecialPermissions();
         this.GetFieldPermission();
         this.GetModelPermission();
     }
 }