Skip to content

Conversation

FinleyGe
Copy link
Collaborator

  • refactor: permission update conflict check function
  • refactor(permission): app collaborator update api
  • refactor(permission): support app update collaborator
  • feat: support fe permission conflict check
  • refactor(permission): app permission
  • refactor(permission): dataset permission
  • refactor(permission): team permission
  • chore: fe adjust
  • fix: type error
  • fix: audit pagiation

Copy link
Contributor

gru-agent bot commented Aug 25, 2025

There is too much information in the pull request to test.

Copy link

github-actions bot commented Aug 25, 2025

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_d7027a93f69c2b700c069d9c279419c008a6e179

Copy link

github-actions bot commented Aug 25, 2025

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_d7027a93f69c2b700c069d9c279419c008a6e179

Copy link

github-actions bot commented Aug 25, 2025

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_d7027a93f69c2b700c069d9c279419c008a6e179

@FinleyGe FinleyGe force-pushed the refactor/inherit-permission branch from 936e75b to a6d7169 Compare August 26, 2025 09:53
@c121914yu c121914yu changed the base branch from main to v4.12.3-dev September 1, 2025 02:18
@FinleyGe FinleyGe force-pushed the refactor/inherit-permission branch from 8742f82 to 0c055d0 Compare September 4, 2025 13:10
@FinleyGe FinleyGe force-pushed the refactor/inherit-permission branch from 0c055d0 to ab48b14 Compare September 4, 2025 13:10
@c121914yu c121914yu force-pushed the v4.12.3-dev branch 2 times, most recently from a149185 to 467f37c Compare September 5, 2025 01:55
@c121914yu c121914yu changed the base branch from v4.12.3-dev to v4.12.4-dev September 9, 2025 03:06
@c121914yu c121914yu requested a review from Copilot September 9, 2025 03:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the permission system to implement an inheritance-based model, removing permission update conflict checks and streamlining permission management. The refactoring includes API changes, frontend adjustments, and fixes for various type and functionality issues.

  • Refactor permission inheritance and conflict checking system
  • Update collaborator management APIs and frontend components
  • Fix type errors and audit pagination issues

Reviewed Changes

Copilot reviewed 60 out of 61 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/setup.ts Update file path to fix test configuration
test/mocks/request.ts Add sessionId field and update import paths for auth functions
test/cases/global/support/permission/utils.test.ts Add comprehensive tests for permission conflict checking
test/cases/global/support/permission/common.test.ts Add owner permission tests and type casting fixes
projects/app/test/api/core/dataset/training/getTrainingDataDetail.test.ts Fix ObjectId comparison by converting to string
projects/app/test/api/core/app/create.test.ts Replace create with findOneAndUpdate for permission handling
projects/app/src/web/support/user/team/group/api.ts Remove debug console.log statement
projects/app/src/web/support/user/team/api.ts Update API signatures and add new updateOneMemberPermission function
projects/app/src/web/core/dataset/api/collaborator.ts Update return type from CollaboratorItemType[] to CollaboratorListType
projects/app/src/web/core/app/api/collaborator.ts Update return type from CollaboratorItemType[] to CollaboratorListType
projects/app/src/service/core/app/utils.ts Add imports for app utilities and permission handling
projects/app/src/pages/dataset/list/index.tsx Add defaultRole parameter for permission management
projects/app/src/pages/dashboard/apps/index.tsx Add defaultRole parameter for app permission management
projects/app/src/pages/api/support/user/account/updatePasswordByOld.ts Remove unused import
projects/app/src/pages/api/support/user/account/loginout.ts Update import path for auth functions
projects/app/src/pages/api/support/user/account/loginByPassword.ts Update import path for setCookie function
projects/app/src/pages/api/core/dataset/update.ts Simplify dataset move logic and update collaborator sync
projects/app/src/pages/api/core/dataset/folder/create.ts Replace manual permission creation with createResourceDefaultCollaborators
projects/app/src/pages/api/core/dataset/create.ts Add resource collaborator creation for new datasets
projects/app/src/pages/api/core/dataset/collection/read.ts Update import path for file token creation
projects/app/src/pages/api/core/app/update.ts Simplify app move logic and remove conditional inheritance handling
projects/app/src/pages/api/core/app/folder/create.ts Replace manual permission setup with createResourceDefaultCollaborators
projects/app/src/pages/api/core/app/create.ts Add default collaborator creation for new apps
projects/app/src/pages/api/common/file/upload.ts Update import path for file token creation
projects/app/src/pages/api/common/file/read/[filename].ts Update import path for file token authentication
projects/app/src/pages/api/common/file/read.ts Update import path for file token authentication
projects/app/src/pageComponents/dataset/list/List.tsx Add defaultRole and fix ID comparison logic
projects/app/src/pageComponents/dataset/detail/Info/index.tsx Add defaultRole parameter for dataset permission management
projects/app/src/pageComponents/dataset/MemberManager.tsx Remove add member button from member manager component
projects/app/src/pageComponents/dashboard/apps/List.tsx Add defaultRole and update permission management
projects/app/src/pageComponents/app/detail/InfoModal.tsx Update collaborator management API calls and UI
projects/app/src/pageComponents/account/team/PermissionManage/index.tsx Update permission management logic and API calls
projects/app/src/pageComponents/account/team/Audit/index.tsx Increase pagination page size
projects/app/src/components/support/permission/MemberManager/context.tsx Major refactor of collaborator context with parent/child relationship support
projects/app/src/components/support/permission/MemberManager/RoleTags.tsx Add flex-wrap and minimum height for better layout
projects/app/src/components/support/permission/MemberManager/RoleSelect.tsx Add permission-based role filtering and disabled state handling
projects/app/src/components/support/permission/MemberManager/MemberModal.tsx Complete rewrite of member modal with new collaboration model
projects/app/src/components/support/permission/MemberManager/MemberItemCard.tsx Add role selection and improved card layout
projects/app/src/components/support/permission/ConfigPerModal/index.tsx Remove add member button from config modal
projects/app/src/components/common/folder/SlideCard.tsx Remove add member functionality from folder slide card
packages/service/support/user/team/controller.ts Update function name from getResourcePermission to getTmbPermission
packages/service/support/permission/utils.ts Add utility function for collaborator ID field extraction
packages/service/support/permission/user/auth.ts Update import paths for auth functions
packages/service/support/permission/schema.ts Add detailed comments for permission schema fields
packages/service/support/permission/publish/authLink.ts Update import path for auth functions
packages/service/support/permission/org/orgSchema.ts Add default avatar getter for organization schema
packages/service/support/permission/memberGroup/controllers.ts Update import path for auth functions
packages/service/support/permission/inheritPermission.ts Major refactor of permission inheritance system
packages/service/support/permission/evaluation/auth.ts Update import path for auth functions
packages/service/support/permission/dataset/auth.ts Simplify dataset permission authentication logic
packages/service/support/permission/controller.ts Major refactor separating auth functions and improving collaborator management
packages/service/support/permission/auth/openapi.ts Update import path for auth functions
packages/service/support/permission/auth/file.ts Move file token functions and update imports
packages/service/support/permission/auth/common.ts Move common auth functions to separate module
packages/service/support/permission/app/auth.ts Simplify app permission authentication
packages/service/common/response/index.ts Update import path for clearCookie function
packages/service/common/mongo/index.ts Add automatic ObjectId to string conversion
packages/global/support/permission/utils.ts Add comprehensive permission utility functions
packages/global/support/permission/type.ts Update type definitions with better generics
Comments suppressed due to low confidence (1)

projects/app/src/components/support/permission/MemberManager/MemberModal.tsx:1

  • The find condition is comparing the same object to itself. It should compare myClb with the current collaborator clb from the parent loop.
import Path from '@/components/common/folder/Path';

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@FinleyGe FinleyGe force-pushed the refactor/inherit-permission branch from e5134c7 to a9c7f95 Compare September 9, 2025 04:03
@c121914yu c121914yu merged commit 08a0ee1 into labring:v4.12.4-dev Sep 11, 2025
5 checks passed
c121914yu pushed a commit that referenced this pull request Sep 11, 2025
* refactor: permission update conflict check function

* refactor(permission): app collaborator update api

* refactor(permission): support app update collaborator

* feat: support fe permission conflict check

* refactor(permission): app permission

* refactor(permission): dataset permission

* refactor(permission): team permission

* chore: fe adjust

* fix: type error

* fix: audit pagiation

* fix: tc

* chore: initv4130

* fix: app/dataset auth logic

* chore: move code

* refactor(permission): remove selfPermission

* fix: mock

* fix: test

* fix: app & dataset auth

* fix: inherit

* test(inheritPermission): test syncChildrenPermission
c121914yu pushed a commit that referenced this pull request Sep 12, 2025
* refactor: permission update conflict check function

* refactor(permission): app collaborator update api

* refactor(permission): support app update collaborator

* feat: support fe permission conflict check

* refactor(permission): app permission

* refactor(permission): dataset permission

* refactor(permission): team permission

* chore: fe adjust

* fix: type error

* fix: audit pagiation

* fix: tc

* chore: initv4130

* fix: app/dataset auth logic

* chore: move code

* refactor(permission): remove selfPermission

* fix: mock

* fix: test

* fix: app & dataset auth

* fix: inherit

* test(inheritPermission): test syncChildrenPermission
c121914yu pushed a commit that referenced this pull request Sep 14, 2025
* refactor: permission update conflict check function

* refactor(permission): app collaborator update api

* refactor(permission): support app update collaborator

* feat: support fe permission conflict check

* refactor(permission): app permission

* refactor(permission): dataset permission

* refactor(permission): team permission

* chore: fe adjust

* fix: type error

* fix: audit pagiation

* fix: tc

* chore: initv4130

* fix: app/dataset auth logic

* chore: move code

* refactor(permission): remove selfPermission

* fix: mock

* fix: test

* fix: app & dataset auth

* fix: inherit

* test(inheritPermission): test syncChildrenPermission
c121914yu added a commit that referenced this pull request Sep 15, 2025
* fix: push again, user select option button and form input radio content overflow (#5601)

* fix: push again, user select option button and form input radio content overflow

* fix: use useCallback instead of useMemo, fix unnecessary delete

* fix: Move the variable inside the component

* fix: do not pass valueLabel to MySelect

* ui

* del collection api adapt

* refactor: inherit permission (#5529)

* refactor: permission update conflict check function

* refactor(permission): app collaborator update api

* refactor(permission): support app update collaborator

* feat: support fe permission conflict check

* refactor(permission): app permission

* refactor(permission): dataset permission

* refactor(permission): team permission

* chore: fe adjust

* fix: type error

* fix: audit pagiation

* fix: tc

* chore: initv4130

* fix: app/dataset auth logic

* chore: move code

* refactor(permission): remove selfPermission

* fix: mock

* fix: test

* fix: app & dataset auth

* fix: inherit

* test(inheritPermission): test syncChildrenPermission

* prompt editor add list plugin (#5620)

* perf: search result (#5608)

* fix: table size (#5598)

* temp: list value

* backspace

* optimize code

---------

Co-authored-by: Archer <[email protected]>
Co-authored-by: 伍闲犬 <[email protected]>

* fix: fe & member list (#5619)

* chore: initv4130

* fix: MemberItemCard

* fix: MemberItemCard

* chore: fe adjust & init script

* perf: test code

* doc

* fix debug variables (#5617)

* perf: search result (#5608)

* fix: table size (#5598)

* fix debug variables

* fix

---------

Co-authored-by: Archer <[email protected]>
Co-authored-by: 伍闲犬 <[email protected]>

* perf: member ui

* fix: inherit bug (#5624)

* refactor(permission): remove getClbsWithInfo, which is useless

* fix: app list privateApp

* fix: get infos

* perf(fe): remove delete icon when it is disable in MemberItemCard

* fix: dataset private dataset

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Archer <[email protected]>
Co-authored-by: Copilot <[email protected]>

* perf: auto coupon

* chore: upgrade script & get infos avatar  (#5625)

* fix: get infos

* chore: initv4130

* feat: support WecomRobot publish, and fix AesKey can not save bug (#5526)

* feat: resolve conflicts

* fix: add param 'show_publish_wecom'

* feat: abstract out WecomCrypto type

* doc: wecom robot document

* fix: solve instability in AI output

* doc: update some pictures

* feat: remove functions from request.ts to chat.ts and toolCall.ts

* doc: wecom robot doc update

* fix

* delete unused code

* doc: update version and prompt

* feat: remove wecom crypto, delete wecom code in workflow

* feat: delete unused codes

---------

Co-authored-by: heheer <[email protected]>

* remove test

* rename init shell

* feat: collection page store

* reload sandbox

* pysandbox

* remove log

* chore: remove useless code (#5629)

* chore: remove useless code

* fix: checkConflict

* perf: support hidden type for RoleList

* fix: copy node

* update doc

* fix(permission): some bug (#5632)

* fix: app/dataset list

* fix: inherit bug

* perf: del app;i18n;save chat

* fix: test

* i18n

* fix: sumper overflow return OwnerRoleVal (#5633)

* remove invalid code

* fix: scroll

* fix: objectId

* update next

* update package

* object id

* mock redis

* feat: add redis append to resolve wecom stream response  (#5643)

* feat: resolve conflicts

* fix: add param 'show_publish_wecom'

* feat: abstract out WecomCrypto type

* doc: wecom robot document

* fix: solve instability in AI output

* doc: update some pictures

* feat: remove functions from request.ts to chat.ts and toolCall.ts

* doc: wecom robot doc update

* fix

* delete unused code

* doc: update version and prompt

* feat: remove wecom crypto, delete wecom code in workflow

* feat: delete unused codes

* feat: add redis append method

---------

Co-authored-by: heheer <[email protected]>

* cache per

* fix(test): init team sub when creating mocked user (#5646)

* fix: button is not vertically centered (#5647)

* doc

* fix: gridFs objectId (#5649)

---------

Co-authored-by: Zeng Qingwen <[email protected]>
Co-authored-by: Finley Ge <[email protected]>
Co-authored-by: heheer <[email protected]>
Co-authored-by: 伍闲犬 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: heheer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants