Skip to content

Commit 1c3e089

Browse files
authored
Fix web share permission access controls (#362)
* fix: align web share permission access UX * chore: add test * fix: keep full access grants reversible * fix: improve landing page error details * test: harden embedded database duplicate edits
1 parent aa24850 commit 1c3e089

25 files changed

Lines changed: 1830 additions & 177 deletions
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
@full-access-share-management
2+
Feature: FullAccess private page share panel controls
3+
The fa0522 FullAccess share-management fixture already exists in the local AppFlowy Cloud database.
4+
These scenarios verify the web share panel controls for owner, member, and guest users on private pages.
5+
6+
Background:
7+
Given the seeded fa0522 full access share-management fixture exists
8+
9+
# Expected result: the private-page owner can manage shares and grant Full access.
10+
Scenario: Owner sees share-management controls on a private page
11+
Given I sign in as full access seeded "owner"
12+
When I open the full access seeded "owner control private page"
13+
And I open the share panel
14+
Then the full access share panel shows seeded "owner" with "Full access"
15+
And the share panel general access is "Restricted"
16+
And the full access share panel can prepare an invite
17+
And the full access invite access selector offers "Full access"
18+
19+
# Expected result: a workspace member with explicit FullAccess can manage sharing on the private page.
20+
Scenario: FullAccess member sees share-management controls on a private page
21+
Given I sign in as full access seeded "full access member"
22+
When I open the full access seeded "member full access private page"
23+
And I open the share panel
24+
Then the full access share panel shows seeded "owner" with "Full access"
25+
And the full access share panel shows seeded "full access member" with "Full access"
26+
And the share panel general access is "Restricted"
27+
And the full access share panel can prepare an invite
28+
And the full access invite access selector offers "Full access"
29+
30+
# Expected result: a workspace member with edit access can open the share panel but cannot invite or grant access.
31+
Scenario: Edit member sees read-only share-management controls on a private page
32+
Given I sign in as full access seeded "edit member"
33+
When I open the full access seeded "member edit private page"
34+
And I open the share panel
35+
Then the full access share panel shows seeded "owner" with "Full access"
36+
And the full access share panel shows seeded "edit member" with "Can edit"
37+
And the full access share panel invite controls are read-only
38+
And the full access seeded "edit member" access menu only allows removing self
39+
40+
# Expected result: a workspace guest with explicit FullAccess can manage sharing on the private page.
41+
Scenario: FullAccess guest sees share-management controls on a private page
42+
Given I sign in as full access seeded "full access guest"
43+
When I open the full access seeded "guest full access private page"
44+
And I open the share panel
45+
Then the full access share panel shows seeded "owner" with "Full access"
46+
And the full access share panel shows seeded "full access guest" with "Full access"
47+
And the share panel general access is "Restricted"
48+
And the full access share panel can prepare an invite
49+
And the full access invite access selector offers "Full access"
50+
51+
# Expected result: guests without FullAccess can open explicitly shared private pages but cannot manage sharing.
52+
Scenario Outline: Non-FullAccess guests see read-only share-management controls
53+
Given I sign in as full access seeded "<account>"
54+
When I open the full access seeded "<page>"
55+
And I open the share panel
56+
Then the full access share panel shows seeded "owner" with "Full access"
57+
And the full access share panel shows seeded "<account>" with "<access>"
58+
And the full access share panel invite controls are read-only
59+
And the full access seeded "<account>" access menu only allows removing self
60+
61+
Examples:
62+
| account | page | access |
63+
| edit guest | guest edit private page | Can edit |
64+
| read guest | guest read only private page | Can view |
65+
66+
# Expected result: a guest with Can view can open the private page but cannot change its title.
67+
Scenario: Read guest cannot edit a private page title
68+
Given I sign in as full access seeded "read guest"
69+
When I open the full access seeded "guest read only private page"
70+
Then the full access seeded page title is visible
71+
And the full access page title cannot be edited to "fa0522 Read Guest Rename Probe"
72+
73+
# Expected result: a guest with Can edit can change the private page title.
74+
Scenario: Edit guest can edit a private page title
75+
Given I sign in as full access seeded "edit guest"
76+
When I open the full access seeded "guest edit private page"
77+
Then the full access seeded page title is visible
78+
And the full access page title is editable
79+
When I rename the full access page title to "fa0522 Edit Guest Rename Probe"
80+
Then the full access page title is "fa0522 Edit Guest Rename Probe"
81+
82+
# Expected result: a workspace guest without an explicit page share cannot open the owner's private page.
83+
Scenario: Unshared guest cannot open a private page
84+
Given I sign in as full access seeded "no share guest"
85+
When I open the full access seeded "owner control private page"
86+
Then the full access seeded "owner control private page" is not opened
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
@seeded-role-matrix
2+
Feature: Seeded role matrix private page permissions
3+
The rm0521 role-matrix fixture already exists in the local AppFlowy Cloud database.
4+
These scenarios verify the web UI behavior for owner, member, guests, and nonmember accounts.
5+
6+
Background:
7+
Given the seeded rm0521 role matrix fixture exists
8+
9+
# Expected result: a private page shared to a guest only lists the owner and that guest.
10+
# Workspace co-owners, members, other guests, and nonmembers must not appear as inherited full-access users.
11+
Scenario: Owner private page share panel only lists explicit guest access
12+
Given I sign in as seeded "owner"
13+
When I open the seeded "owner guest read private page"
14+
And I open the share panel
15+
Then the share panel shows seeded "owner" with "Full access"
16+
And the share panel shows seeded "guest reader" with "Can view"
17+
And the share panel does not show seeded "co-owner"
18+
And the share panel does not show seeded "member"
19+
And the share panel does not show seeded "guest writer"
20+
And the share panel does not show seeded "guest no share"
21+
And the share panel does not show seeded "nonmember"
22+
And the share panel general access is "Restricted"
23+
24+
# Expected result: a private page shared to a workspace member lists that member with edit access,
25+
# without leaking other workspace members or guests into the people-with-access list.
26+
Scenario: Owner private page share panel lists explicit member access
27+
Given I sign in as seeded "owner"
28+
When I open the seeded "owner member write private page"
29+
And I open the share panel
30+
Then the share panel shows seeded "owner" with "Full access"
31+
And the share panel shows seeded "member" with "Can edit"
32+
And the share panel does not show seeded "co-owner"
33+
And the share panel does not show seeded "guest reader"
34+
And the share panel does not show seeded "guest writer"
35+
And the share panel does not show seeded "guest no share"
36+
And the share panel does not show seeded "nonmember"
37+
And the share panel general access is "Restricted"
38+
39+
# Expected result: a read-only guest can open the explicitly shared private page,
40+
# sees restricted general access, and cannot edit the page title.
41+
Scenario: Guest reader can open the shared private page but cannot edit the title
42+
Given I sign in as seeded "guest reader"
43+
When I open the seeded "owner guest read private page"
44+
Then the seeded page title is visible
45+
And the page title is read-only
46+
When I open the share panel
47+
Then the share panel shows seeded "guest reader" with "Can view"
48+
And the share panel general access is "Restricted"
49+
50+
# Expected result: a write guest can open and rename the explicitly shared private page.
51+
Scenario: Guest writer can open and rename the shared private page
52+
Given I sign in as seeded "guest writer"
53+
When I open the seeded "owner guest write private page"
54+
Then the seeded page title is visible
55+
And the page title is editable
56+
When I rename the page title to "rm0521 Writer BDD Rename Probe Private Page"
57+
Then the page title is "rm0521 Writer BDD Rename Probe Private Page"
58+
59+
# Expected result: a workspace co-owner does not inherit access to another user's unshared private page.
60+
Scenario: Co-owner cannot open the owner's unshared private page
61+
Given I sign in as seeded "co-owner"
62+
When I open the seeded "owner unshared private page"
63+
Then the no access page is shown
64+
65+
# Expected result: a normal workspace member does not inherit access to another user's unshared private page.
66+
Scenario: Member cannot open the owner's unshared private page
67+
Given I sign in as seeded "member"
68+
When I open the seeded "owner unshared private page"
69+
Then the no access page is shown
70+
71+
# Expected result: a workspace member can open and edit a private page explicitly shared to them.
72+
Scenario: Member can open the owner private page explicitly shared to them
73+
Given I sign in as seeded "member"
74+
When I open the seeded "owner member write private page"
75+
Then the seeded page title is visible
76+
And the page title is editable
77+
78+
# Expected result: a workspace member can open a page in a public space while it is public.
79+
# After the owner changes that space to Private in the web UI, the same member loses access to
80+
# the page and sees the no-access screen instead of the private-space content.
81+
Scenario: Member loses access when a public space becomes private
82+
Given I sign in as seeded "owner"
83+
And I create a temporary public space page in the seeded workspace
84+
When I open the temporary seeded page
85+
Then the temporary seeded page title is visible
86+
When I sign in as seeded "member"
87+
And I open the temporary seeded page
88+
Then the temporary seeded page title is visible
89+
When I sign in as seeded "owner"
90+
And I change the temporary seeded space permission to "Private"
91+
And I sign in as seeded "member"
92+
And I open the temporary seeded page
93+
Then the no access page is shown
94+
And the temporary seeded space is hidden from the sidebar
95+
And the temporary seeded page editor is not visible
96+
97+
# Expected result: a guest with no explicit share cannot open workspace pages or another guest's shared private page.
98+
Scenario: Guest with no page share cannot open seeded pages
99+
Given I sign in as seeded "guest no share"
100+
When I open the seeded "public page"
101+
Then the no access page is shown
102+
And the seeded page title is not visible
103+
When I open the seeded "owner guest read private page"
104+
Then the no access page is shown
105+
106+
# Expected result: a user outside the workspace cannot open the seeded workspace public page.
107+
Scenario: Nonmember cannot open the workspace public page
108+
Given I sign in as seeded "nonmember"
109+
When I open the seeded "public page"
110+
Then the no access page is shown
111+
And the seeded page title is not visible

0 commit comments

Comments
 (0)