zoukankan      html  css  js  c++  java
  • 创建用户组

    SPSecurity.RunWithElevatedPrivileges(delegate()
                    {

                        using (SPSite site = new SPSite(curSite.ID))
                        {
                            using (SPWeb web = site.OpenWeb(curWeb.ID))
                            {

                                site.AllowUnsafeUpdates = true;
                                web.AllowUnsafeUpdates = true;
                                SPMember spUserMember = null;
                                SPUser spUser = web.CurrentUser;
                                //spUserMember = web.SiteAdministrators[0];
                                spUserMember = curWeb.CurrentUser;
                                web.SiteGroups.Add(strUserGroup, spUserMember, null, description);

                                SPList spList = web.Lists["用户信息列表"];
                                SPGroup spgroup = web.SiteGroups[strUserGroup];
                                SPListItem groupItem = spList.GetItemById(spgroup.ID);

                                groupItem["Create"] = (object)curWeb.CurrentUser.LoginName;
                                groupItem["Modifier"] = (object)curWeb.CurrentUser.LoginName;
                                groupItem["IsGroup"] = (object)"职责";
                                groupItem["IsEnable"] = (object)ddlIsEnable.SelectedValue;
                                groupItem.Update();
                                site.AllowUnsafeUpdates = false;
                                web.AllowUnsafeUpdates = false;
                            }
                        }
                    });

  • 相关阅读:
    BSS Audio® Introduces Full-Bandwidth Acoustic Echo Cancellation Algorithm for Soundweb London Conferencing Processors
    转:虚拟运营商颠覆八大行业 170号码将成主流?
    移动通信调制技术的进展 转
    转:瑞利信道,莱斯信道和高斯信道模型
    转:Android开发之旅:环境搭建及HelloWorld
    web端视频直播网站的弊端和优势
    频域分辨率与DFT,DCT,MDCT理解
    转:超声波支付
    谈音频算法技术研发团队建立
    转:HTML5标准与性能之四:asm.js
  • 原文地址:https://www.cnblogs.com/hqbird/p/2044325.html
Copyright © 2011-2022 走看看