public bool Evaluate(EvaluationContext evaluationContext, ref object state)
        {
            IIdentity identity = GetIdentityFromClient(evaluationContext);
            XmlIdentity xmlIdentity =
                new XmlIdentity(identity.AuthenticationType, identity.Name);

            evaluationContext.Properties["Principal"] =
                new XmlPrincipal(
                    xmlIdentity,
                    XmlSecurityHelper.GetRolesByUserName(xmlIdentity.Name));

            return true;
        }
Example #2
0
 public XmlPrincipal(XmlIdentity identity, string[] roles)
 {
     this._identity = identity;
     this._roles = roles;
 }