本文整理汇总了C#中IUserContext类的典型用法代码示例。如果您正苦于以下问题:C# IUserContext类的具体用法?C# IUserContext怎么用?C# IUserContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUserContext类属于命名空间,在下文中一共展示了IUserContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UsersController
public UsersController(
IMessageBus messageBus,
IUserContext userContext,
IProjectViewModelQuery projectViewModelQuery,
ISightingViewModelQuery sightingViewModelQuery,
IActivityViewModelQuery activityViewModelQuery,
IPostViewModelQuery postViewModelQuery,
IUserViewModelQuery userViewModelQuery,
IPermissionManager permissionManager,
IDocumentSession documentSession
)
{
Check.RequireNotNull(messageBus, "messageBus");
Check.RequireNotNull(userContext, "userContext");
Check.RequireNotNull(projectViewModelQuery, "projectViewModelQuery");
Check.RequireNotNull(sightingViewModelQuery, "sightingViewModelQuery");
Check.RequireNotNull(activityViewModelQuery, "activityViewModelQuery");
Check.RequireNotNull(postViewModelQuery, "postViewModelQuery");
Check.RequireNotNull(userViewModelQuery, "userViewModelQuery");
Check.RequireNotNull(permissionManager, "permissionManager");
Check.RequireNotNull(documentSession, "documentSession");
_messageBus = messageBus;
_userContext = userContext;
_projectViewModelQuery = projectViewModelQuery;
_sightingViewModelQuery = sightingViewModelQuery;
_activityViewModelQuery = activityViewModelQuery;
_postViewModelQuery = postViewModelQuery;
_userViewModelQuery = userViewModelQuery;
_permissionManager = permissionManager;
_documentSession = documentSession;
}
示例2: GroupListConfiguration
public GroupListConfiguration(IUserContext userContext) : base(typeof(GroupListModel))
{
this.InterfaceResourceType = typeof(Resources.Interface);
this.CanCreate = userContext.HasPermission(MembershipPermissions.AddGroup);
this.CanEdit = userContext.HasPermission(MembershipPermissions.EditGroup);
this.CanDelete = userContext.HasPermission(MembershipPermissions.DeleteGroup);
}
示例3: ActivityViewModelQuery
public ActivityViewModelQuery(
IDocumentSession documentSession,
ISightingViewFactory sightingViewFactory,
ISightingNoteViewFactory sightingNoteViewFactory,
IIdentificationViewFactory identificationViewFactory,
IPostViewFactory postViewFactory,
IUserContext userContext,
IUserViewFactory userViewFactory)
{
Check.RequireNotNull(documentSession, "documentSession");
Check.RequireNotNull(sightingViewFactory, "sightingViewFactory");
Check.RequireNotNull(sightingNoteViewFactory, "sightingNoteViewFactory");
Check.RequireNotNull(identificationViewFactory, "identificationViewFactory");
Check.RequireNotNull(postViewFactory, "postViewFactory");
Check.RequireNotNull(userContext, "userContext");
Check.RequireNotNull(userViewFactory, "userViewFactory");
_documentSession = documentSession;
_sightingViewFactory = sightingViewFactory;
_sightingNoteViewFactory = sightingNoteViewFactory;
_identificationViewFactory = identificationViewFactory;
_postViewFactory = postViewFactory;
_userContext = userContext;
_userViewFactory = userViewFactory;
}
示例4: SubsController
public SubsController(IContextService contextService,
ISubDao subDao,
IMapper mapper,
ICommandBus commandBus,
IUserContext userContext,
IPostDao postDao,
IVoteDao voteDao,
ICommentDao commentDao,
IPermissionDao permissionDao,
ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder,
ICommentTreeContextBuilder commentTreeContextBuilder,
IPostWrapper postWrapper,
ISubWrapper subWrapper,
ICommentWrapper commentWrapper)
{
_contextService = contextService;
_subDao = subDao;
_mapper = mapper;
_commandBus = commandBus;
_userContext = userContext;
_postDao = postDao;
_voteDao = voteDao;
_commentDao = commentDao;
_permissionDao = permissionDao;
_commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
_commentTreeContextBuilder = commentTreeContextBuilder;
_postWrapper = postWrapper;
_subWrapper = subWrapper;
_commentWrapper = commentWrapper;
}
示例5: EnterpriseTesterRaygunMessageBuilderFactory
public EnterpriseTesterRaygunMessageBuilderFactory(IUserContext userContext, ILicenseManager licenseManager)
{
if (userContext == null) throw new ArgumentNullException("userContext");
if (licenseManager == null) throw new ArgumentNullException("licenseManager");
_userContext = userContext;
_licenseManager = licenseManager;
}
开发者ID:KodiEhf,项目名称:EnterpriseTester-API-Examples,代码行数:7,代码来源:EnterpriseTesterRaygunMessageBuilderFactory.cs
示例6: FileManagerController
/// <summary>
/// Constructor for the file manager.
/// </summary>
/// <remarks>This action requires editor rights.</remarks>
public FileManagerController(ApplicationSettings settings, UserServiceBase userManager, IUserContext context,
SettingsService settingsService, AttachmentFileHandler attachment)
: base(settings, userManager, context, settingsService)
{
_attachmentHandler = attachment;
_attachmentPathUtil = new AttachmentPathUtil(settings);
}
示例7: ImportNotificationApplicationAuthorization
public ImportNotificationApplicationAuthorization(IwsContext context,
ImportNotificationContext importNotificationContext, IUserContext userContext)
{
this.context = context;
this.importNotificationContext = importNotificationContext;
this.userContext = userContext;
}
示例8: MenuParser
public MenuParser(MarkupConverter markupConverter, IRepository repository, SiteCache siteCache, IUserContext userContext)
{
_markupConverter = markupConverter;
_repository = repository;
_siteCache = siteCache;
_userContext = userContext;
}
示例9: HomeController
public HomeController(
IMessageBus messageBus,
IUserContext userContext,
IActivityViewModelQuery activityViewModelQuery,
ISightingViewModelQuery sightingViewModelQuery,
IUserViewModelQuery userViewModelQuery,
IDocumentSession documentSession,
IPostViewModelQuery postViewModelQuery
)
{
Check.RequireNotNull(messageBus, "messageBus");
Check.RequireNotNull(userContext, "userContext");
Check.RequireNotNull(activityViewModelQuery, "activityViewModelQuery");
Check.RequireNotNull(sightingViewModelQuery, "sightingViewModelQuery");
Check.RequireNotNull(userViewModelQuery, "userViewModelQuery");
Check.RequireNotNull(documentSession, "documentSession");
Check.RequireNotNull(postViewModelQuery, "postViewModelQuery");
_messageBus = messageBus;
_userContext = userContext;
_activityViewModelQuery = activityViewModelQuery;
_sightingViewModelQuery = sightingViewModelQuery;
_userViewModelQuery = userViewModelQuery;
_documentSession = documentSession;
_postViewModelQuery = postViewModelQuery;
}
示例10: MenuParser
public MenuParser(MarkupConverter markupConverter, ISettingsRepository settingsRepository, SiteCache siteCache, IUserContext userContext)
{
_markupConverter = markupConverter;
_settingsRepository = settingsRepository;
_siteCache = siteCache;
_userContext = userContext;
}
示例11: CapturedMovementFactory
public CapturedMovementFactory(IMovementNumberValidator movementNumberValidator, INotificationAssessmentRepository assessmentRepository,
IUserContext userContext)
{
this.movementNumberValidator = movementNumberValidator;
this.assessmentRepository = assessmentRepository;
this.userContext = userContext;
}
示例12: UpgradeController
public UpgradeController(ApplicationSettings settings, IRepository repository, UserServiceBase userService,
IUserContext context, SettingsService settingsService, ConfigReaderWriter configReaderWriter)
: base(settings, userService, context, settingsService)
{
_repository = repository;
_configReaderWriter = configReaderWriter;
}
示例13: ProfileController
public ProfileController(IUserProfileBusinessLogic userProfileBusinessLogic, IGenderViewTypeConverter genderTypeConverter, IActivityLevelViewTypeConverter activityLevelViewTypeConverter, IUserContext userContext)
{
ActivityLevelViewTypeConverter = activityLevelViewTypeConverter;
GenderTypeConverter = genderTypeConverter;
UserProfileBusinessLogic = userProfileBusinessLogic;
UserContext = userContext;
}
示例14: RoleListConfiguration
public RoleListConfiguration(IUserContext userContext) : base(typeof(RoleViewModel), null)
{
this.InterfaceResourceType = typeof(Resources.Interface);
this.CanCreate = userContext.HasPermission(MembershipPermissions.AddRole);
this.CanEdit = userContext.HasPermission(MembershipPermissions.EditRole);
this.CanDelete = userContext.HasPermission(MembershipPermissions.DeleteRole);
}
示例15: CommitAction
/// <summary>
/// Commits one action of the transaction.
/// </summary>
/// <param name="userContext">The user context.</param>
/// <param name="transac">The transac.</param>
/// <param name="index">The index.</param>
/// <param name="action">The action.</param>
protected override void CommitAction(IUserContext userContext, TransacInfo transac, int index, TransacActionInfo action)
{
object referenceObject = null;
if (action.Type == TransacActionType.Insert)
{
referenceObject = action.TargetInstance;
}
else
{
referenceObject = action.SourceInstance;
}
IMetamodelEntity metamodelEntity = IoC.Get<ISecurityManager>().MetamodelManager.GetEntity(referenceObject.GetType());
if (metamodelEntity != null)
{
if (metamodelEntity.AuditType == AuditType.Simple)
{
AuditTransacAction actionEntity = new AuditTransacAction();
actionEntity.AuditTransacId = Convert.ToInt32(transac.TransacId);
actionEntity.AuditTransacActionIx = index + 1;
actionEntity.EntityId = metamodelEntity.EntId;
actionEntity.PrimaryKey = metamodelEntity.GetStringKey(referenceObject);
userContext.Context.Add(actionEntity);
}
}
}