Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 4
0
 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();
             }
         }
     }
 }