当前位置: 首页>>代码示例>>C#>>正文


C# IAuthorizationService类代码示例

本文整理汇总了C#中IAuthorizationService的典型用法代码示例。如果您正苦于以下问题:C# IAuthorizationService类的具体用法?C# IAuthorizationService怎么用?C# IAuthorizationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IAuthorizationService类属于命名空间,在下文中一共展示了IAuthorizationService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProposalsListViewModel

        public ProposalsListViewModel(
            [Import]IBackgroundExecutor executor,
            [Import]IEventAggregator eventAggregator,
            [Import]IDialogService dialogs,
            [Import]IAuthorizationService authorizator,
            [Import]IBacklogService backlogService,
            [Import]IProposalsService proposalsService)
        {
            this.executor = executor;
                this.dialogs = dialogs;
                this.aggregator = eventAggregator;

                this.authorizator = authorizator;
                this.proposalsService = proposalsService;
                this.backlogService = backlogService;

                this.aggregator.Subscribe<Project>(ScrumFactoryEvent.ViewProjectDetails, OnViewProjectDetails);

                this.aggregator.Subscribe(ScrumFactoryEvent.RoleHourCostsChanged, LoadProposals);
                this.aggregator.Subscribe<MemberProfile>(ScrumFactoryEvent.SignedMemberChanged, OnSignedMemberChanged);

                this.aggregator.Subscribe(ScrumFactoryEvent.ApplicationWhentBackground, () => { ShowValues = false; });

                OnLoadCommand = new DelegateCommand(CanSeeProposals, () => {
                    ShowValues = false;
                    if (NeedRefresh) LoadProposals();
                });
                AddProposalCommand = new DelegateCommand(CanSeeProposals, AddProposal);
                ShowDetailCommand = new DelegateCommand<Proposal>(CanSeeProposals, ShowDetail);
                ShowHourCostsCommand = new DelegateCommand(CanSeeProposals, ShowHourCosts);
        }
开发者ID:klot-git,项目名称:scrum-factory,代码行数:31,代码来源:ProposalsListViewModel.cs

示例2: BurndownViewModel

        public BurndownViewModel(
            [Import] IBacklogService backlogService,
            [Import] IProjectsService projectsService,
            [Import] IBackgroundExecutor backgroundExecutor,
            [Import] IEventAggregator eventAggregator,
            [Import] IAuthorizationService authorizator)
        {
            this.backlogService = backlogService;
            this.projectsService = projectsService;
            this.executor = backgroundExecutor;
            this.aggregator = eventAggregator;
            this.authorizator = authorizator;

            NeedRefresh = false;

            OnLoadCommand = new DelegateCommand(() => {if (NeedRefresh) LoadData();});
            SetBaselineCommand = new DelegateCommand(_CanChangeBaseline, SetBaseline);

            aggregator.Subscribe<Project>(ScrumFactoryEvent.ViewProjectDetails, p=> {
                Project = p;
                SetPlannings();
                AskForRefresh();
            });

            aggregator.Subscribe<Project>(ScrumFactoryEvent.BurndownShouldRefresh, AskForRefresh);
            aggregator.Subscribe<ICollection<Sprint>>(ScrumFactoryEvent.SprintsDateChanged, o => { AskForRefresh(); });
            aggregator.Subscribe<BacklogItem[]>(ScrumFactoryEvent.BacklogItemsChanged, b => { AskForRefresh(); });
        }
开发者ID:klot-git,项目名称:scrum-factory,代码行数:28,代码来源:BurndownViewModel.cs

示例3: SetupEntities

        private void SetupEntities()
        {
            user = new User();
            user.Name = "Ayende";
            account = new Account();
            account.Name = "south sand";

            UnitOfWork.CurrentSession.Save(user);
            UnitOfWork.CurrentSession.Save(account);

            authorizationService = IoC.Resolve<IAuthorizationService>();
            permissionService = IoC.Resolve<IPermissionsService>();
            permissionsBuilderService = IoC.Resolve<IPermissionsBuilderService>();
            authorizationRepository = IoC.Resolve<IAuthorizationRepository>();
            authorizationRepository.CreateUsersGroup("Administrators");
            authorizationRepository.CreateEntitiesGroup("Important Accounts");
            authorizationRepository.CreateOperation("/Account/Edit");

            UnitOfWork.Current.TransactionalFlush();

            authorizationRepository.AssociateUserWith(user, "Administrators");
            authorizationRepository.AssociateEntityWith(account, "Important Accounts");

            UnitOfWork.Current.TransactionalFlush();
        }
开发者ID:brumschlag,项目名称:rhino-tools,代码行数:25,代码来源:DatabaseFixture.cs

示例4: ReportPostAdminController

 public ReportPostAdminController(
     IOrchardServices orchardServices,
     IForumService forumService,
     IThreadService threadService,
     IPostService postService,
     ISiteService siteService,
     IShapeFactory shapeFactory,
     IAuthorizationService authorizationService,
     IAuthenticationService authenticationService,
     ISubscriptionService subscriptionService,
     IReportPostService reportPostService,
     ICountersService countersService
     )
 {
     _orchardServices = orchardServices;
     _forumService = forumService;
     _threadService = threadService;
     _postService = postService;
     _siteService = siteService;
     _subscriptionService = subscriptionService;
     _authorizationService = authorizationService;
     _authenticationService = authenticationService;
     _reportPostService = reportPostService;
     _countersService = countersService;
     T = NullLocalizer.Instance;
     Shape = shapeFactory;
 }
开发者ID:jon123,项目名称:NGM.Forum,代码行数:27,代码来源:ReportPostAdminController.cs

示例5: ApiController

 public ApiController(
     IContentManager contentManager,
     IAuthorizationService authorizationService)
 {
     _authorizationService = authorizationService;
     _contentManager = contentManager;
 }
开发者ID:MichaelPetrinolis,项目名称:Orchard2,代码行数:7,代码来源:ApiController.cs

示例6: SessionController

 /// <summary>
 /// Session controller constructor.
 /// </summary>
 /// <param name="sessionRepository">The session repository.</param>
 /// <param name="materialRepository">The material repository.</param>
 /// <param name="eventsRepository">The events repository.</param>
 /// <param name="authorizationService">The authorization service.</param>
 public SessionController(ISessionRepository sessionRepository, IMaterialRepository materialRepository, IEventDefinitionRepository eventsRepository, IAuthorizationService authorizationService)
 {
     _sessionRepository = sessionRepository;
     _materialRepository = materialRepository;
     _eventsRepository = eventsRepository;
     _authorizationService = authorizationService;
 }
开发者ID:garymedina,项目名称:MyEvents,代码行数:14,代码来源:SessionController.cs

示例7: SetupController

        public SetupController(
            IApplicationEnvironment appEnv,
            ILogger<SetupController> logger,
            IOptions<SetupOptions> setupOptionsAccessor,
            SetupManager setupManager,
            IAuthorizationService authorizationService,
            IEnumerable<ISetupTask> setupSteps = null
        )
        {
            if (appEnv == null) { throw new ArgumentNullException(nameof(appEnv)); }
            if (logger == null) { throw new ArgumentNullException(nameof(logger)); }
            if (setupOptionsAccessor == null) { throw new ArgumentNullException(nameof(setupOptionsAccessor)); }
            if (setupManager == null) { throw new ArgumentNullException(nameof(setupManager)); }
            if (authorizationService == null) { throw new ArgumentNullException(nameof(authorizationService)); }

            log = logger;
            appBasePath = appEnv.ApplicationBasePath;
            this.setupManager = setupManager;
            setupOptions = setupOptionsAccessor.Value;
            this.authorizationService = authorizationService;
            if(setupSteps != null)
            {
                this.setupSteps = setupSteps;
            }

        }
开发者ID:joeaudette,项目名称:cloudscribe.Setup,代码行数:26,代码来源:SetupController.cs

示例8: AdminController

        public AdminController(
            IContentDefinitionDisplayManager contentDefinitionDisplayManager,
            IContentDefinitionService contentDefinitionService,
            IContentDefinitionManager contentDefinitionManager,
            ShellSettings settings,
            IAuthorizationService authorizationService,
            ISession session,
            ILogger<AdminController> logger,
            IHtmlLocalizer<AdminMenu> htmlLocalizer,
            IStringLocalizer<AdminMenu> stringLocalizer,
            INotifier notifier
            )
        {
            _notifier = notifier;
            _contentDefinitionDisplayManager = contentDefinitionDisplayManager;
            _session = session;
            _authorizationService = authorizationService;
            _contentDefinitionService = contentDefinitionService;
            _contentDefinitionManager = contentDefinitionManager;
            _settings = settings;

            Logger = logger;
            T = htmlLocalizer;
            S = stringLocalizer;
        }
开发者ID:rodpl,项目名称:Orchard2,代码行数:25,代码来源:AdminController.cs

示例9: AccountController

 public AccountController(IUserService userService, IAuthorizationService authService, IAnswerService answerService, ITaskService taskService)
 {
     this.userService = userService;
     this.authService = authService;
     this.answerService = answerService;
     this.taskService = taskService;
 }
开发者ID:TheTypoMaster,项目名称:Task,代码行数:7,代码来源:AccountController.cs

示例10: Authorizer

        public Authorizer(IAuthorizationService authorizationService, IWorkContextAccessor workContextAccessor)
        {
            _authorizationService = authorizationService;
            _workContextAccessor = workContextAccessor;

            T = NullLocalizer.Instance;
        }
开发者ID:l1183479157,项目名称:RabbitHub,代码行数:7,代码来源:Authorizer.cs

示例11: SubscriptionController

        public SubscriptionController(
            IOrchardServices orchardServices,
            IForumService forumService,
            IThreadService threadService,
            IPostService postService,
            ISiteService siteService,
            IShapeFactory shapeFactory,
            IAuthorizationService authorizationService,
            IAuthenticationService authenticationService,
            ISubscriptionService subscriptionService,
            IThreadLastReadService threadLastReadService
            )
        {
            _orchardServices = orchardServices;
            _forumService = forumService;
            _threadService = threadService;
            _postService = postService;
            _siteService = siteService;
            _subscriptionService = subscriptionService;
            _authorizationService = authorizationService;
            _authenticationService = authenticationService;
            _threadLastReadService = threadLastReadService;

            T = NullLocalizer.Instance;
            Shape = shapeFactory;
        }
开发者ID:jon123,项目名称:NGM.Forum,代码行数:26,代码来源:SubscriptionController.cs

示例12: SimBalanceViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="SimBalanceViewModel" /> class.
        /// </summary>
        /// <param name="simBalance">The sim balance.</param>
        /// <param name="topUpHistory">The top up history.</param>
        /// <param name="usageHistory">The usage history.</param>
        /// <param name="authorizationService">The authorization service.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="resourceLoader">The resource loader.</param>
        /// <exception cref="System.ArgumentNullException"></exception>
        public SimBalanceViewModel(ISimBalance simBalance, ITopUpHistory topUpHistory, IUsageHistory usageHistory, IAuthorizationService authorizationService, INavigationService navigationService, ResourceLoader resourceLoader)
            : base(authorizationService, resourceLoader, navigationService)
        {
            if (simBalance == null)
            {
                throw new ArgumentNullException("simBalance");
            }
            if (topUpHistory == null)
            {
                throw new ArgumentNullException("topUpHistory");
            }
            if (usageHistory == null)
            {
                throw new ArgumentNullException("usageHistory");
            }

            _mobileNumber = (DTO.MobileNumber)NavigationService.Parameter;

            _simBalanceRepository = simBalance;
            _topUpHistory = topUpHistory;
            _usageHistory = usageHistory;

            Groups = new ObservableCollection<Group>();

            HandleNoInternet();
            LoadBalance();

        }
开发者ID:prebenh,项目名称:MobileVikings,代码行数:38,代码来源:SimBalanceViewModel.cs

示例13: DefaultRpcInvoker

		/// <param name="authorizationService">Service that authorizes each method for use if configured</param>
		/// <param name="policyProvider">Provides authorization policies for the authroziation service</param>
		/// <param name="logger">Optional logger for logging Rpc invocation</param>
		/// <param name="serverConfig">Configuration data for the server</param>
		public DefaultRpcInvoker(IAuthorizationService authorizationService, IAuthorizationPolicyProvider policyProvider, ILogger<DefaultRpcInvoker> logger, IOptions<RpcServerConfiguration> serverConfig)
		{
			this.authorizationService = authorizationService;
			this.policyProvider = policyProvider;
			this.logger = logger;
			this.serverConfig = serverConfig;
		}
开发者ID:edjCase,项目名称:JsonRpc,代码行数:11,代码来源:DefaultRpcInvoker.cs

示例14: AdminMenu

 public AdminMenu(IAuthorizationService authorizationService, IWorkContextAccessor workContextAccessor
     , IOrchardServices orchardServices)
 {
     _authorizationService = authorizationService;
     _workContextAccessor = workContextAccessor;
     _orchardServices = orchardServices;
 }
开发者ID:ccccccmd,项目名称:Orchard.WeChat,代码行数:7,代码来源:AdminMenu.cs

示例15: Context

 protected override void Context()
 {
     MockAuthorizationService = MockRepository.GenerateStub<IAuthorizationService>();
     MockDocumentRepository = MockRepository.GenerateStub<IDocumentRepository>();
     MockCustomerRepository = MockRepository.GenerateStub<ICustomerRepository>();
     //DocumentService = new DocumentService(MockAuthorizationService, MockDocumentRepository, MockCustomerRepository);
 }
开发者ID:AcklenAvenue,项目名称:PRTools,代码行数:7,代码来源:given_a_document_service_context.cs


注:本文中的IAuthorizationService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。