[PR #8017] [MERGED] feat: control access level in share menu #8270

Closed
opened 2026-03-23 23:23:24 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/8017
Author: @LucasXu0
Created: 6/3/2025
Status: Merged
Merged: 6/3/2025
Merged by: @LucasXu0

Base: mainHead: access_level_2


📝 Commits (10+)

  • a287cd7 feat: use auto_confirm in share with user api
  • 446f595 feat: reduce share api calls
  • ae2aa89 feat: add team space section in title bar
  • f7454a5 feat: only user with full access can invite guest/member
  • 237b885 feat: customize popup style
  • c98ac34 feat: support section type
  • 7d39e63 feat: update access level based on public or private space
  • 5262de5 test: add access level tests
  • 406509d chore: update i18n
  • 904c656 chore: disable bloc talker

📊 Changes

34 files changed (+707 additions, -210 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/features/share_tab/data/models/share_access_level.dart (+4 -4)
📝 frontend/appflowy_flutter/lib/features/share_tab/data/models/share_section_type.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/features/share_tab/data/repositories/local_share_with_user_repository_impl.dart (+32 -8)
📝 frontend/appflowy_flutter/lib/features/share_tab/data/repositories/rust_share_with_user_repository_impl.dart (+38 -1)
📝 frontend/appflowy_flutter/lib/features/share_tab/data/repositories/share_with_user_repository.dart (+9 -0)
📝 frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_bloc.dart (+16 -8)
📝 frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_state.dart (+7 -1)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/share_tab.dart (+52 -27)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/access_level_list_widget.dart (+0 -1)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/copy_link_widget.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/general_access_section.dart (+3 -1)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/people_with_access_section.dart (+3 -0)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/share_with_user_widget.dart (+19 -2)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/shared_group_widget.dart (+11 -16)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/shared_user_widget.dart (+57 -49)
📝 frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/turn_into_member_widget.dart (+12 -6)
📝 frontend/appflowy_flutter/lib/plugins/ai_chat/chat.dart (+15 -2)
📝 frontend/appflowy_flutter/lib/plugins/database/tab_bar/tab_bar_view.dart (+23 -4)
📝 frontend/appflowy_flutter/lib/plugins/document/document.dart (+32 -5)
📝 frontend/appflowy_flutter/lib/plugins/document/document_page.dart (+0 -4)

...and 14 more files

📄 Description

Feature Preview

Space Type Self Role Access Level Can Change Own Access? Can Change Others' Access?
Public Owner Full Access No (disabled) Yes (Only Guest)
Public Member Full Access No (disabled) Yes (Only Guest)
Public Guest Read & Write / Read Only No (disabled) No (disabled)
Private Owner/Member Full Access No (disabled) Yes (edit: R/O, R/W)
Private Owner/Member Read & Write / Read Only Remove self only No (disabled)
Private Guest Read & Write / Read Only No (disabled) No (disabled)

PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Implement and enforce page access levels across the Flutter frontend by integrating the PageAccessLevelBloc into document plugins and UI widgets, restricting actions based on user roles, adding contextual tooltips, and improving observability for access-level changes.

New Features:

  • Restrict invite actions to users with full access and hide space views for guests based on access level
  • Display access level tooltips on view titles and share UI elements
  • Introduce auto-confirm flag on share requests and surface turn-into-member results via toast notifications

Enhancements:

  • Integrate PageAccessLevelBloc into DocumentPlugin and consolidate BlocProviders for consistent access control
  • Simplify icon rendering in shared group widget and unify tooltip usage in share and lock actions
  • Refactor debug logging to filter only PageAccessLevelBloc transitions and bump talker_bloc_logger version

Build:

  • Bump talker_bloc_logger dependency to ^4.8.1

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/8017 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 6/3/2025 **Status:** ✅ Merged **Merged:** 6/3/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `access_level_2` --- ### 📝 Commits (10+) - [`a287cd7`](https://github.com/AppFlowy-IO/AppFlowy/commit/a287cd74a4441189b0d1934227c30b8f5a57ff73) feat: use auto_confirm in share with user api - [`446f595`](https://github.com/AppFlowy-IO/AppFlowy/commit/446f595b2083c22b828de865e76711f6b7cc0ee6) feat: reduce share api calls - [`ae2aa89`](https://github.com/AppFlowy-IO/AppFlowy/commit/ae2aa89f5aa4c0a472b665b7377b635c45aa1f0b) feat: add team space section in title bar - [`f7454a5`](https://github.com/AppFlowy-IO/AppFlowy/commit/f7454a5c2d33d0a82588b1b17d236e41f621b22b) feat: only user with full access can invite guest/member - [`237b885`](https://github.com/AppFlowy-IO/AppFlowy/commit/237b885fd78fc1b567fd181605403860f1d73fe0) feat: customize popup style - [`c98ac34`](https://github.com/AppFlowy-IO/AppFlowy/commit/c98ac34e9acb6fc941f9b581eca2fb434bd45ffa) feat: support section type - [`7d39e63`](https://github.com/AppFlowy-IO/AppFlowy/commit/7d39e63a3885d63cb43b23d2b4909de91357016f) feat: update access level based on public or private space - [`5262de5`](https://github.com/AppFlowy-IO/AppFlowy/commit/5262de538a9a1aa810ae78910833171f2c136391) test: add access level tests - [`406509d`](https://github.com/AppFlowy-IO/AppFlowy/commit/406509d1aa23cb0d83103724042a153a4e8bd028) chore: update i18n - [`904c656`](https://github.com/AppFlowy-IO/AppFlowy/commit/904c656bd498c3a80764c515dd20e47361e6eddc) chore: disable bloc talker ### 📊 Changes **34 files changed** (+707 additions, -210 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/models/share_access_level.dart` (+4 -4) 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/models/share_section_type.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/repositories/local_share_with_user_repository_impl.dart` (+32 -8) 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/repositories/rust_share_with_user_repository_impl.dart` (+38 -1) 📝 `frontend/appflowy_flutter/lib/features/share_tab/data/repositories/share_with_user_repository.dart` (+9 -0) 📝 `frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_bloc.dart` (+16 -8) 📝 `frontend/appflowy_flutter/lib/features/share_tab/logic/share_tab_state.dart` (+7 -1) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/share_tab.dart` (+52 -27) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/access_level_list_widget.dart` (+0 -1) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/copy_link_widget.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/general_access_section.dart` (+3 -1) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/people_with_access_section.dart` (+3 -0) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/share_with_user_widget.dart` (+19 -2) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/shared_group_widget.dart` (+11 -16) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/shared_user_widget.dart` (+57 -49) 📝 `frontend/appflowy_flutter/lib/features/share_tab/presentation/widgets/turn_into_member_widget.dart` (+12 -6) 📝 `frontend/appflowy_flutter/lib/plugins/ai_chat/chat.dart` (+15 -2) 📝 `frontend/appflowy_flutter/lib/plugins/database/tab_bar/tab_bar_view.dart` (+23 -4) 📝 `frontend/appflowy_flutter/lib/plugins/document/document.dart` (+32 -5) 📝 `frontend/appflowy_flutter/lib/plugins/document/document_page.dart` (+0 -4) _...and 14 more files_ </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview | Space Type | Self Role | Access Level | Can Change Own Access? | Can Change Others' Access? | |------------|---------------|------------------------|-----------------------------|---------------------------------| | Public | Owner | Full Access | No (disabled) | Yes (Only Guest) | | Public | Member | Full Access | No (disabled) | Yes (Only Guest) | | Public | Guest | Read & Write / Read Only| No (disabled) | No (disabled) | | Private | Owner/Member | Full Access | No (disabled) | Yes (edit: R/O, R/W) | | Private | Owner/Member | Read & Write / Read Only| Remove self only | No (disabled) | | Private | Guest | Read & Write / Read Only| No (disabled) | No (disabled) | <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. ## Summary by Sourcery Implement and enforce page access levels across the Flutter frontend by integrating the PageAccessLevelBloc into document plugins and UI widgets, restricting actions based on user roles, adding contextual tooltips, and improving observability for access-level changes. New Features: - Restrict invite actions to users with full access and hide space views for guests based on access level - Display access level tooltips on view titles and share UI elements - Introduce auto-confirm flag on share requests and surface turn-into-member results via toast notifications Enhancements: - Integrate PageAccessLevelBloc into DocumentPlugin and consolidate BlocProviders for consistent access control - Simplify icon rendering in shared group widget and unify tooltip usage in share and lock actions - Refactor debug logging to filter only PageAccessLevelBloc transitions and bump talker_bloc_logger version Build: - Bump talker_bloc_logger dependency to ^4.8.1 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:23:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8270
No description provided.