zoukankan      html  css  js  c++  java
  • sharepoint 加载用户组出现权限受限

     private void BindFirstApply()
            {


                using (SPWeb web = SPControl.GetContextSite(Context).OpenWeb())
                {
                  
                    DataTable ownerTable = Make_Table();
                    foreach (SPUser user in web.SiteUsers)
                    {
                        for (int i = 0; i < user.Groups.Count; i++)
                        {
                         
                            if (user.Groups[i].ToString() == "项目经理" && user.Name.ToString() != "System Account")
                            {
                                DataRow newRow = ownerTable.NewRow();
                                newRow["Name"] = user.Name.ToString();
                                newRow["LoginName"] = user.LoginName;
                                ownerTable.Rows.Add(newRow);
                            }
                        }
                    }
                    DropDownListFirstApplyer.DataSource = ownerTable;
                    DropDownListFirstApplyer.DataTextField = "Name";
                    DropDownListFirstApplyer.DataValueField = "LoginName";
                    DropDownListFirstApplyer.DataBind();

                }
            }


            private DataTable Make_Table()
            {
                DataTable nameTable = new DataTable("Names");
                nameTable.Columns.Add("Name");
                nameTable.Columns.Add("LoginName");

                return nameTable;
            }

  • 相关阅读:
    [hosts]在hosts中屏蔽一级域名和二级域名的写法
    [oracle]查询一个表中数据的插入时间
    [Windows Doc]微软官方文档
    [PL]如果天空是黑暗的,那就摸黑生存
    [LVM]创建LVM卷
    [powershell]获取FCID&Port
    [oracle]解决ora-01034 oracle not available
    [GoogleBlog]new-approach-to-china
    [时钟]配置日期时间并同步到硬件
    [rhel]安装oracle11g
  • 原文地址:https://www.cnblogs.com/KingStar/p/1608558.html
Copyright © 2011-2022 走看看