这是基于vue-vben-admin 模板适用于abp vNext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
colin 3936107340 upgrade: upgrade abp to 10.0.2 2 months ago
..
LINGYUN/Abp/Identity/OrganizaztionUnits upgrade abp framework to 8.2.0 2 years ago
FodyWeavers.xml upgrade(abp): upgrade abp framework to 7.4.0 2 years ago
FodyWeavers.xsd upgrade(abp): upgrade abp framework to 7.4.0 2 years ago
LINGYUN.Abp.Identity.OrganizaztionUnits.csproj upgrade: upgrade abp to 10.0.2 2 months ago
README.EN.md feat(docs): 添加identity模块文档 1 year ago
README.md feat(docs): 添加identity模块文档 1 year ago

README.md

LINGYUN.Abp.Identity.OrganizaztionUnits

身份认证组织单元模块,提供身份认证系统与组织单元的集成功能。

功能特性

  • 扩展AbpIdentityDomainModule模块
  • 集成AbpAuthorizationOrganizationUnitsModule模块
  • 支持组织单元声明动态添加
  • 提供组织单元相关的身份认证功能

模块引用

[DependsOn(
    typeof(AbpIdentityDomainModule),
    typeof(AbpAuthorizationOrganizationUnitsModule))]
public class YouProjectModule : AbpModule
{
  // other
}

配置项

AbpClaimsPrincipalFactoryOptions

{
  "Abp": {
    "Security": {
      "Claims": {
        "DynamicClaims": {
          "OrganizationUnit": true  // 启用组织单元动态声明
        }
      }
    }
  }
}

声明类型

  • AbpOrganizationUnitClaimTypes.OrganizationUnit - 组织单元声明类型
    • 用于标识用户所属的组织单元
    • 在用户身份验证时自动添加到声明中

基本用法

  1. 配置组织单元声明
public override void ConfigureServices(ServiceConfigurationContext context)
{
    Configure<AbpClaimsPrincipalFactoryOptions>(options =>
    {
        options.DynamicClaims.Add(AbpOrganizationUnitClaimTypes.OrganizationUnit);
    });
}
  1. 获取用户的组织单元声明
public class YourService
{
    private readonly ICurrentUser _currentUser;

    public YourService(ICurrentUser currentUser)
    {
        _currentUser = currentUser;
    }

    public string[] GetUserOrganizationUnits()
    {
        return _currentUser.FindClaims(AbpOrganizationUnitClaimTypes.OrganizationUnit)
            .Select(c => c.Value)
            .ToArray();
    }
}

更多信息