コード例 #1
0
        // Get members of group g
        internal override BookmarkableResultSet GetGroupMembership(GroupPrincipal g, bool recursive)
        {
            // Enforced by the methods that call us
            Debug.Assert(g.unpersisted == false);

            // Fake groups are a member of other groups, but they themselves have no members
            // (they don't even exist in the store)
            if (g.fakePrincipal)
            {
                GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMStoreCtx", "GetGroupMembership: is fake principal, returning empty set");
                return(new EmptySet());
            }

            Debug.Assert(g.UnderlyingObject != null);

            DirectoryEntry groupDE = (DirectoryEntry)g.UnderlyingObject;

            UnsafeNativeMethods.IADsGroup iADsGroup = (UnsafeNativeMethods.IADsGroup)groupDE.NativeObject;

            BookmarkableResultSet resultSet = new SAMMembersSet(groupDE.Path, iADsGroup, recursive, this, _ctxBase);

            return(resultSet);
        }
コード例 #2
0
ファイル: SAMStoreCtx.cs プロジェクト: chcosta/corefx
        // Get members of group g
        internal override BookmarkableResultSet GetGroupMembership(GroupPrincipal g, bool recursive)
        {
            // Enforced by the methods that call us
            Debug.Assert(g.unpersisted == false);

            // Fake groups are a member of other groups, but they themselves have no members
            // (they don't even exist in the store)
            if (g.fakePrincipal)
            {
                GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMStoreCtx", "GetGroupMembership: is fake principal, returning empty set");
                return new EmptySet();
            }

            Debug.Assert(g.UnderlyingObject != null);

            DirectoryEntry groupDE = (DirectoryEntry)g.UnderlyingObject;

            UnsafeNativeMethods.IADsGroup iADsGroup = (UnsafeNativeMethods.IADsGroup)groupDE.NativeObject;

            BookmarkableResultSet resultSet = new SAMMembersSet(groupDE.Path, iADsGroup, recursive, this, _ctxBase);
            return resultSet;
        }
コード例 #3
0
ファイル: SAMStoreCtx.cs プロジェクト: nickchal/pash
		internal override BookmarkableResultSet GetGroupMembership(GroupPrincipal g, bool recursive)
		{
			if (!g.fakePrincipal)
			{
				DirectoryEntry underlyingObject = (DirectoryEntry)g.UnderlyingObject;
				UnsafeNativeMethods.IADsGroup nativeObject = (UnsafeNativeMethods.IADsGroup)underlyingObject.NativeObject;
				BookmarkableResultSet sAMMembersSet = new SAMMembersSet(underlyingObject.Path, nativeObject, recursive, this, this.ctxBase);
				return sAMMembersSet;
			}
			else
			{
				return new EmptySet();
			}
		}