本文整理汇总了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);
}
示例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(); });
}
示例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();
}
示例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;
}
示例5: ApiController
public ApiController(
IContentManager contentManager,
IAuthorizationService authorizationService)
{
_authorizationService = authorizationService;
_contentManager = contentManager;
}
示例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;
}
示例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;
}
}
示例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;
}
示例9: AccountController
public AccountController(IUserService userService, IAuthorizationService authService, IAnswerService answerService, ITaskService taskService)
{
this.userService = userService;
this.authService = authService;
this.answerService = answerService;
this.taskService = taskService;
}
示例10: Authorizer
public Authorizer(IAuthorizationService authorizationService, IWorkContextAccessor workContextAccessor)
{
_authorizationService = authorizationService;
_workContextAccessor = workContextAccessor;
T = NullLocalizer.Instance;
}
示例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;
}
示例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();
}
示例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;
}
示例14: AdminMenu
public AdminMenu(IAuthorizationService authorizationService, IWorkContextAccessor workContextAccessor
, IOrchardServices orchardServices)
{
_authorizationService = authorizationService;
_workContextAccessor = workContextAccessor;
_orchardServices = orchardServices;
}
示例15: Context
protected override void Context()
{
MockAuthorizationService = MockRepository.GenerateStub<IAuthorizationService>();
MockDocumentRepository = MockRepository.GenerateStub<IDocumentRepository>();
MockCustomerRepository = MockRepository.GenerateStub<ICustomerRepository>();
//DocumentService = new DocumentService(MockAuthorizationService, MockDocumentRepository, MockCustomerRepository);
}