コード例 #1
0
ファイル: UnknownPrincipal.cs プロジェクト: chcosta/corefx
        //
        // Internal "constructor": Used for constructing UnknownPrincipal
        //
        static internal UnknownPrincipal CreateUnknownPrincipal(PrincipalContext ctx, byte[] sid, string name)
        {
            UnknownPrincipal up = new UnknownPrincipal(ctx);
            up.unpersisted = false;
            up.fakePrincipal = true;

            // Set the display name on the object
            up.LoadValueIntoProperty(PropertyNames.PrincipalDisplayName, name);

            // Set the display name on the object
            up.LoadValueIntoProperty(PropertyNames.PrincipalName, name);

            // SID IdentityClaim
            SecurityIdentifier sidObj = new SecurityIdentifier(Utils.ConvertSidToSDDL(sid));

            // Set the display name on the object
            up.LoadValueIntoProperty(PropertyNames.PrincipalSid, sidObj);
            return up;
        }
コード例 #2
0
        //
        // Internal "constructor": Used for constructing UnknownPrincipal
        //
        static internal UnknownPrincipal CreateUnknownPrincipal(PrincipalContext ctx, byte[] sid, string name)
        {
            UnknownPrincipal up = new UnknownPrincipal(ctx);

            up.unpersisted   = false;
            up.fakePrincipal = true;

            // Set the display name on the object
            up.LoadValueIntoProperty(PropertyNames.PrincipalDisplayName, name);

            // Set the display name on the object
            up.LoadValueIntoProperty(PropertyNames.PrincipalName, name);

            // SID IdentityClaim
            SecurityIdentifier sidObj = new SecurityIdentifier(Utils.ConvertSidToSDDL(sid));

            // Set the display name on the object
            up.LoadValueIntoProperty(PropertyNames.PrincipalSid, sidObj);
            return(up);
        }