public DistributorRole ToDistributorRole() { return(new DistributorRole( Allow.Aggregate(Role.None, (aggregate, role) => aggregate | role), Deny.Aggregate(Role.None, (aggregate, role) => aggregate | role), IsAuthorizationRequired, FeedRoles?.ToDictionary(x => x.Key, x => x.Value.ToFeedRole(x.Key)))); }
public InteractorRole ToInteractorRole(string host, string user) { var expandedHost = Environment.ExpandEnvironmentVariables(host); return(new InteractorRole( expandedHost, user, Allow.Aggregate(Role.None, (aggregate, role) => aggregate | role), Deny.Aggregate(Role.None, (aggregate, role) => aggregate | role))); }
public FeedRole ToFeedRole(string feed) { return(new FeedRole( feed, Allow.Aggregate(Role.None, (aggregate, role) => aggregate | role), Deny.Aggregate(Role.None, (aggregate, role) => aggregate | role), IsAuthorized, IsImpersonationAllowed, IsProxyAllowed, InteractorRoles?.SelectMany(x => x.Value.Select(y => y.Value.ToInteractorRole(x.Key, y.Key)))?.ToList())); }