private static void AddPoliciesToClaimsMt(string[] policies, long tenantId, IMultiTenantIamProvider <long> iamProvider, IMultiTenantIamProviderCache <long> iamProviderCache) { foreach (var policy in policies) { iamProvider.AddClaim(policy, tenantId, policy, iamProviderCache).Wait(); } }
public IamMultiTenantAuthorizationPolicyProvider(IOptions <AuthorizationOptions> options, IMultiTenantIamProvider <TTenantKey> iamProvider, IMultiTenantIamProviderCache <TTenantKey> iamProviderCache, ITenantProvider <TTenantKey> tenantProvider) : base(options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } _options = options.Value; _iamProvider = iamProvider ?? throw new ArgumentNullException(nameof(iamProvider)); _iamProviderCache = iamProviderCache ?? throw new ArgumentNullException(nameof(iamProviderCache)); _tenantProvider = tenantProvider ?? throw new ArgumentNullException(nameof(tenantProvider)); }
private static void TogglePolicyResourceIdAccessMt(string[] policies, long tenantId, IMultiTenantIamProvider <long> iamProvider, IMultiTenantIamProviderCache <long> iamProviderCache) { foreach (var policy in policies) { iamProvider.ToggleResourceIdAccess(policy, tenantId, true, iamProviderCache).Wait(); } }
private static void AddPoliciesToRolesMt(string[] policies, string[] roles, long[] tenantIds, IMultiTenantIamProvider <long> iamProvider, IMultiTenantIamProviderCache <long> iamProviderCache) { foreach (var policy in policies) { foreach (var role in roles) { foreach (var tenantId in tenantIds) { iamProvider.AddRole(policy, tenantId, role, iamProviderCache).Wait(); } } } }