Git Product home page Git Product logo

Comments (4)

Canway-shiisa avatar Canway-shiisa commented on June 12, 2024 2

权限中心的组织架构数据是通过调用用户管理接口来生成的:
1.同步用户:/api/v2/profiles/(在ESB中为/api/c/compapi/v2/usermanage/list_users/

  • 新增:遍历接口获取过来的所有新数据,对比数据库中原本的用户旧数据,对于新增的用户执行新增的变更
  • 更新:对于变更了 display_name、staff_status、category_id的用户,进行更新操作
  • 删除:遍历接口获取过来的所有新数据,对比数据库中原本的用户旧数据,不存在的用户则为需要删除的,进行删除处理

2.同步部门:/api/v2/departments/(在ESB中为/api/c/compapi/v2/usermanage/list_departments/

  • 新建:遍历接口获取过来的所有新数据,对比数据库中原本的部门数据,对于新增的部门执行新增的变更
  • 更新部门拓扑:更新变更了parent的部门
  • 删除部门:遍历接口获取过来的所有新数据,对比数据库中原本的部门旧数据,不存在的部门则为需要删除的,进行删除处理【使用BFS转换出可顺序删除的列表,以mptt方式进行删除处理】
  • 更新部门基本信息:对于变更了的name、category_id、order的部门,进行更新操作

3.同步部门与用户关系:/api/v2/edges/department_profile/(在ESB中为/api/c/compapi/v2/usermanage/list_edges_department_profile/

  • 新增部门成员:遍历接口获取过来的所有新数据,对比数据库中原本的用户旧数据,对于新增的部门成员执行新增的变更
  • 删除部门成员:遍历接口获取过来的所有新数据,对比数据库中原本的用户旧数据,不存在的用户则为需要删除的,进行删除处理

4.同步用户与leader的关系:/api/v2/edges/leader/(在ESB中为/api/c/compapi/v2/usermanage/list_edges_leader_profile/

  • 新建用户leader:遍历接口获取过来的所有新数据,对比数据库中原本的用户旧数据,对于新增的用户执行新增的变更
  • 删除用户leader:遍历接口获取过来的所有新数据,对比数据库中原本的用户旧数据,不存在的用户则为需要删除的,进行删除处理

from bk-user.

uddmorningsun avatar uddmorningsun commented on June 12, 2024

能具体再描述下吗? 权限中心同步接口 是指哪个接口呢?(从代码层面以及 git log 中不能获得有效信息)

$ grep 权限中心同步 -Rn ./*
./docs/release.md:242:- [NEW] 增加关系API,加速权限中心同步
./src/saas/RELEASE.yaml:104:      - "增加关系API,加速权限中心同步"

$ git blame docs/release.md | grep 242
^7ccc4e1 (IMBlues 2021-08-10 11:18:19 +0800 242) - [NEW] 增加关系API,加速权限中心同步
$ git blame ./src/saas/RELEASE.yaml | grep 104
^7ccc4e1 (IMBlues 2021-08-10 11:18:19 +0800 104)       - "增加关系API,加速权限中心同步"

P.S.:个人建议一般 issue 中对于接口层面描述尽可能用 API Path + Method + Option Params 比较清晰明了,否则理解成本较高;或者即使异常堆栈也能提供有效信息。

from bk-user.

IMBlues avatar IMBlues commented on June 12, 2024

能具体再描述下吗? 权限中心同步接口 是指哪个接口呢?(从代码层面以及 git log 中不能获得有效信息)

$ grep 权限中心同步 -Rn ./*
./docs/release.md:242:- [NEW] 增加关系API,加速权限中心同步
./src/saas/RELEASE.yaml:104:      - "增加关系API,加速权限中心同步"

$ git blame docs/release.md | grep 242
^7ccc4e1 (IMBlues 2021-08-10 11:18:19 +0800 242) - [NEW] 增加关系API,加速权限中心同步
$ git blame ./src/saas/RELEASE.yaml | grep 104
^7ccc4e1 (IMBlues 2021-08-10 11:18:19 +0800 104)       - "增加关系API,加速权限中心同步"

P.S.:个人建议一般 issue 中对于接口层面描述尽可能用 API Path + Method + Option Params 比较清晰明了,否则理解成本较高;或者即使异常堆栈也能提供有效信息。

@uddmorningsun 这里有一些预先的背景没有提出来。蓝鲸权限中心 SaaS 是通过用户管理的 API 来同步数据的(用户、部门等),具体的逻辑后面会让相关同学在这里补充简述一下。

from bk-user.

IMBlues avatar IMBlues commented on June 12, 2024

暂时没有这个需求,先 close,有想法时可以再打开

from bk-user.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.