public PermissionValueProviderManager(
            IServiceProvider serviceProvider,
            IOptions <AbpPermissionOptions> options)
        {
            Options = options.Value;

            _lazyProviders = new Lazy <List <IPermissionValueProvider> >(
                () => Options
                .ValueProviders
                .Select(c => serviceProvider.GetRequiredService(c) as IPermissionValueProvider)
                .ToList(),
                true
                );
        }
Пример #2
0
        public PermissionDefinitionManager(
            IOptions <AbpPermissionOptions> options,
            IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
            Options          = options.Value;

            _lazyPermissionDefinitions = new Lazy <Dictionary <string, PermissionDefinition> >(
                CreatePermissionDefinitions,
                isThreadSafe: true
                );

            _lazyPermissionGroupDefinitions = new Lazy <Dictionary <string, PermissionGroupDefinition> >(
                CreatePermissionGroupDefinitions,
                isThreadSafe: true
                );
        }
Пример #3
0
 public PermissionStateManager(IServiceProvider serviceProvider, IOptions <AbpPermissionOptions> options)
 {
     ServiceProvider = serviceProvider;
     Options         = options.Value;
 }