Пример #1
0
        public static bool isUserMemberOf(String userName, string groupName, IQueryService qrySrvc)
        {
            string query = string.Format(
                "SELECT i_all_users_names FROM dm_group WHERE group_name = '{0}' AND ANY i_all_users_names = '{1}'",
                groupName, userName);
            QueryResult queryResult = DfsHelper.executePassThrough(qrySrvc, query);

            if (queryResult.DataObjects.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="groupName"></param>
 /// <param name="qrySvc"></param>
 public static void removeUserFromGroup(string userName, string groupName, IQueryService qrySvc)
 {
     string      query       = string.Format("ALTER GROUP '{0}' DROP '{1}'", groupName, userName);
     QueryResult queryResult = DfsHelper.executePassThrough(qrySvc, query);
 }