本文整理汇总了C#中ISecurityContext类的典型用法代码示例。如果您正苦于以下问题:C# ISecurityContext类的具体用法?C# ISecurityContext怎么用?C# ISecurityContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISecurityContext类属于命名空间,在下文中一共展示了ISecurityContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveSettingsCommand
public SaveSettingsCommand(SettingsViewModel viewModel, ISettingsRepositories repos, IUserNotify notify, ISecurityContext ctx)
{
this.viewModel = viewModel;
this.repos = repos;
this.notify = notify;
this.ctx = ctx;
}
示例2: SaveReleaseNoteCommand
public SaveReleaseNoteCommand(ReleaseNoteViewModel viewModel, IReleaseNoteRepositories repo, IUserNotify notify, ISecurityContext ctx)
{
this.viewModel = viewModel;
this.repos = repo;
this.notify = notify;
this.ctx = ctx;
}
示例3: PartInspectionViewModel
public PartInspectionViewModel(ISession session, IPartInspectionRepository repos, IUserNotify notify, ISecurityContext ctx)
{
try
{
this.session = session;
this.repos = repos;
this.notify = notify;
this.ctx = ctx;
this.Inspectors = repos.RepoInspector.GetAll();
if(this.Inspectors == null || this.Inspectors.Count <= 0)
log.Warn("Incoming Inspection of Componentry: List of Inspectors is NULL or empty");
searchCommand = ViewModelSource.Create(() => new SearchPartForInspectionCommand(this, session, ctx));
saveInspectionTestResultsCommand = ViewModelSource.Create(() => new SaveInspectionTestResultsCommand(repos.RepoInspectionTestResult, this, notify, ctx));
saveAndClearTestResultsCommand = ViewModelSource.Create(() => new SaveAndClearTestResultsCommand(this));
this.Inspectors = repos.RepoInspector.GetAll();
}
catch(RepositoryException ex)
{
log.Warn(this.GetType().Name + " | " + ex.ToString());
notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
}
}
示例4: SecurityContextWrapper
public SecurityContextWrapper(ISecurityContext securityContext)
{
if (securityContext == null)
throw new ArgumentNullException("securityContext");
_securityContext = securityContext;
}
示例5: EnforcePolicies
public IEnumerable<PolicyResult> EnforcePolicies(ISecurityContext context)
{
if (_policies.Count.Equals(0))
throw ExceptionFactory.CreateConfigurationErrorsException("You must add at least 1 policy for controller {0} action {1}.".FormatWith(ControllerName, ActionName));
return _policies.Select(policy => policy.Enforce(context)).ToArray();
}
示例6: AuthenticationContextService
public AuthenticationContextService(ISecurityContext securityContext, IPrincipalFactory principalFactory, ICurrentSDKUser currentSdkUser, ILogger logger)
{
_securityContext = securityContext;
_principalFactory = principalFactory;
_currentSdkUser = currentSdkUser;
_logger = logger;
}
示例7: AuthenticationRequiredBehavior
public AuthenticationRequiredBehavior(ISecurityContext securityContext, IUrlRegistry urlRegistry, IOutputWriter outputWriter)
: base(PartialBehavior.Ignored)
{
_securityContext = securityContext;
_urlRegistry = urlRegistry;
_outputWriter = outputWriter;
}
示例8: SaveInspectionTestResultsCommand
public SaveInspectionTestResultsCommand(IInspectionTestResultRepository repo, PartInspectionViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
{
this.repo = repo;
this.viewModel = viewModel;
this.notify = notify;
this.ctx = ctx;
}
示例9: SpoolDeactivationCommand
public SpoolDeactivationCommand(ISpoolRepositories repo, SpoolViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
{
this.repo = repo;
this.viewModel = viewModel;
this.notify = notify;
this.ctx = ctx;
}
示例10: AddAction
public AddAction(IDailyTimeRecordService timeRecordService, IUserService userService, ISecurityContext securityContext)
{
_timeRecordService = timeRecordService;
_userService = userService;
_securityContext = securityContext;
}
示例11: StatusPointsService
public StatusPointsService(IAppraiserOrderDeliveryService appraiserOrderDeliveryService, DashboardConditionFilters dashboardConditionFilters, ICurrentAppraiser currentAppraiser, ISecurityContext securityContext)
{
_securityContext = ValidationUtil.CheckOnNullAndThrowIfNull(securityContext);
_appraiserOrderDeliveryService = ValidationUtil.CheckOnNullAndThrowIfNull(appraiserOrderDeliveryService);
_dashboardConditionFilters = ValidationUtil.CheckOnNullAndThrowIfNull(dashboardConditionFilters);
_currentAppraiser = ValidationUtil.CheckOnNullAndThrowIfNull(currentAppraiser);
}
示例12: PolicyViolationException
internal PolicyViolationException(PolicyResult policyResult, ISecurityContext securityContext)
: base(policyResult.Message)
{
PolicyResult = policyResult;
SecurityContext = securityContext;
PolicyType = PolicyResult.PolicyType;
}
示例13: SpiderFactory
public SpiderFactory(ILogger logger, ISecurityContext securityContext, IMediaFactory mediaFactory, ILinkRepository linkRepository, ITagRepository tagRepository, IMediaRepository mediaRepository, IMetadataRepository mediaItemRepository, IAudioStreamFactory audioStreamFactory)
{
if (logger == null)
throw new ArgumentNullException("logger");
if (securityContext == null)
throw new ArgumentNullException("securityContext");
if (mediaFactory == null)
throw new ArgumentNullException("mediaFactory");
if (linkRepository == null)
throw new ArgumentNullException("linkRepository");
if (tagRepository == null)
throw new ArgumentNullException("tagRepository");
if (mediaRepository == null)
throw new ArgumentNullException("mediaRepository");
if (mediaItemRepository == null)
throw new ArgumentNullException("mediaItemRepository");
this.logger = logger;
this.securityContext = securityContext;
this.securityContext = securityContext;
this.mediaFactory = mediaFactory;
this.linkRepository = linkRepository;
this.tagRepository = tagRepository;
this.mediaRepository = mediaRepository;
this.mediaItemRepository = mediaItemRepository;
this.audioStreamFactory = audioStreamFactory;
}
示例14: Initialize
public void Initialize(ILogger logger, ISecurityContext securityContext, IMediaFactory mediaFactory, IMetadataController mediaItemController, ITaskController taskController, ITagController tagController, IVideoPlayer videoPlayer)
{
if (logger == null)
throw new ArgumentNullException("logger");
if (securityContext == null)
throw new ArgumentNullException("securityContext");
if (mediaFactory == null)
throw new ArgumentNullException("mediaFactory");
if (mediaItemController == null)
throw new ArgumentNullException("mediaItemController");
if (taskController == null)
throw new ArgumentNullException("taskController");
if (tagController == null)
throw new ArgumentNullException("tagController");
if (videoPlayer == null)
throw new ArgumentNullException("videoPlayer");
this.logger = logger;
this.securityContext = securityContext;
this.mediaFactory = mediaFactory;
this.taskController = taskController;
this.mediaItemController = mediaItemController;
this.tagController = tagController;
this.videoPlayer = videoPlayer;
}
示例15: Enforce
public PolicyResult Enforce(ISecurityContext context)
{
var innerPolicy = new RequireAllRolesPolicy(UserRole.Administrator);
var result = innerPolicy.Enforce(context);
return result.ViolationOccured ? PolicyResult.CreateFailureResult(this, result.Message) : PolicyResult.CreateSuccessResult(this);
}