Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResourceAccessRuleSetService"/> class.
 /// </summary>
 /// <param name="tenancyHelper">The tenant provider.</param>
 /// <param name="permissionsStoreFactory">Provides access to the permissions store.</param>
 public ResourceAccessRuleSetService(
     IMarainServicesTenancy tenancyHelper,
     IPermissionsStoreFactory permissionsStoreFactory)
 {
     this.tenancyHelper           = tenancyHelper ?? throw new ArgumentNullException(nameof(tenancyHelper));
     this.permissionsStoreFactory = permissionsStoreFactory ?? throw new ArgumentNullException(nameof(permissionsStoreFactory));
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClaimPermissionsService"/> class.
 /// </summary>
 /// <param name="permissionsStoreFactory">Provides access to the permissions store.</param>
 /// <param name="marainServicesTenancy">The Marain services tenancy provider.</param>
 /// <param name="serializerSettingsProvider">The serializer settings provider.</param>
 public ClaimPermissionsService(
     IPermissionsStoreFactory permissionsStoreFactory,
     IMarainServicesTenancy marainServicesTenancy,
     IJsonSerializerSettingsProvider serializerSettingsProvider)
 {
     this.permissionsStoreFactory    = permissionsStoreFactory ?? throw new ArgumentNullException(nameof(permissionsStoreFactory));
     this.marainServicesTenancy      = marainServicesTenancy ?? throw new ArgumentNullException(nameof(marainServicesTenancy));
     this.serializerSettingsProvider = serializerSettingsProvider ?? throw new ArgumentNullException(nameof(serializerSettingsProvider));
 }
Exemple #3
0
        public static async Task TearDownBlobContainers(FeatureContext context)
        {
            ITenant          transientTenant = TransientTenantManager.GetInstance(context).PrimaryTransientClient;
            IServiceProvider serviceProvider = ContainerBindings.GetServiceProvider(context);

            if (transientTenant != null && serviceProvider != null)
            {
                IPermissionsStoreFactory permissionsStoreFactory = serviceProvider.GetRequiredService <IPermissionsStoreFactory>();

                await context.RunAndStoreExceptionsAsync(async() =>
                {
                    var claimsStore = (ClaimPermissionsStore)await permissionsStoreFactory.GetClaimPermissionsStoreAsync(transientTenant);
                    await claimsStore.Container.DeleteAsync();
                }).ConfigureAwait(false);

                await context.RunAndStoreExceptionsAsync(async() =>
                {
                    var ruleSetsStore = (ResourceAccessRuleSetStore)await permissionsStoreFactory.GetResourceAccessRuleSetStoreAsync(transientTenant);
                    await ruleSetsStore.Container.DeleteAsync();
                }).ConfigureAwait(false);
            }
        }