/// <summary> /// Initializes a new instance of the <see cref="AuthorizationService"/> class. /// </summary> /// <param name="workItem">The work item.</param> public AuthorizationService([ServiceDependency]WorkItem workItem) { lock (syncObj) { this.workItem = workItem; authorizationStoreService = workItem.Services.Get<IAuthorizationStoreService>(); if (authorizationStoreService != null) { authorizations = authorizationStoreService.GetAuthorizationsByUser(Thread.CurrentPrincipal.Identity.Name); // 获取当前用户的所有授权信息 } } }
/// <summary> /// Initializes a new instance of the <see cref="AuthorizationService"/> class. /// </summary> /// <param name="workItem">The work item.</param> public AuthorizationService([ServiceDependency] WorkItem workItem) { lock (syncObj) { this.workItem = workItem; authorizationStoreService = workItem.Services.Get <IAuthorizationStoreService>(); if (authorizationStoreService != null) { authorizations = authorizationStoreService.GetAuthorizationsByUser(Thread.CurrentPrincipal.Identity.Name); // 获取当前用户的所有授权信息 } } }