public ActivityRegistrationConfigurator(IRegistrationConfigurator configurator, IActivityRegistration registration, IContainerRegistrar registrar) { _configurator = configurator; _registration = registration; _registrar = registrar; }
public IList <IActivityAuthorizer> GetAuthorizers(IActivity activity) { IActivityRegistration registration = null; var registrations = _activityRegistrations.Where(a => a.ActivityType == activity.GetType()).ToList(); IList <KeyValuePair <Type, Action <IActivityAuthorizer> > > types = null; if (registrations.Count() == 1) { registration = registrations.First(); } if (registration == null && activity is MethodActivity) { registration = _activityRegistrations.SingleOrDefault(r => r.ActivityMethod == ((MethodActivity)activity).Info); } if (registration == null) { registration = _activityRegistrations.SingleOrDefault(r => r.ActivityName == activity.Name); } if (registration != null) { types = registration.AuthorizerTypes; } if (types != null && types.Any(a => a.Key == typeof(AllowAnonymous))) { types = new[] { new KeyValuePair <Type, Action <IActivityAuthorizer> >(typeof(AllowAnonymous), null) } } ; if (types != null) { return(BuildAuthorizers(types)); } return(new[] { _authorizerFactory.BuildDefaultAuthorizer() }); }
public bool Matches(IActivityRegistration registration) { return(_filter.Matches(registration.ActivityType)); }