Example #1
0
 /// <summary>
 /// Set the metadata of authentication.
 /// </summary>
 /// <param name="authentication"></param>
 protected virtual void SetAuthentication(EntityAuthenticationAttribute authentication)
 {
     if (authentication == null)
         throw new ArgumentNullException("authentication");
     AllowAnonymous = authentication.AllowAnonymous;
     AddRoles = new ReadOnlyCollection<string>(authentication.AddRolesRequired);
     EditRoles = new ReadOnlyCollection<string>(authentication.EditRolesRequired);
     ViewRoles = new ReadOnlyCollection<string>(authentication.ViewRolesRequired);
     RemoveRoles = new ReadOnlyCollection<string>(authentication.RemoveRolesRequired);
 }