Skip to content

feat: gate project-specific roles on supportsProjectSpecificRoles plag#3078

Merged
HarshMN2345 merged 7 commits into
mainfrom
feat-project-specific-roles-plan-flag
Jun 4, 2026
Merged

feat: gate project-specific roles on supportsProjectSpecificRoles plag#3078
HarshMN2345 merged 7 commits into
mainfrom
feat-project-specific-roles-plan-flag

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

Update SDK to @appwrite.io/console@82069e6 which exposes the new flag. Replace supportsOrganizationRoles with supportsProjectSpecificRoles in createMember, edit, and members page — org roles and project-specific roles are now independently gated by their own plan flags.

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

…n flag

Update SDK to @appwrite.io/console@82069e6 which exposes the new flag.
Replace supportsOrganizationRoles with supportsProjectSpecificRoles in
createMember, edit, and members page — org roles and project-specific
roles are now independently gated by their own plan flags.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 4, 2026

Greptile Summary

This PR decouples organization roles from project-specific roles by replacing the removed granularProjectAccess feature flag with the new supportsProjectSpecificRoles plan field exposed by the updated SDK. The "Edit role" button in the members table is now correctly visible whenever either supportsOrganizationRoles or supportsProjectSpecificRoles is set.

  • +page.svelte: Introduces separate supportsOrgRoles and supportsProjectRoles reactive vars and widens the Edit button gate to supportsOrgRoles || supportsProjectRoles, ensuring both plan types can reach the edit modal.
  • createMember.svelte / edit.svelte: supportsProjectRoles now reads directly from supportsProjectSpecificRoles; the edit.svelte modal continues to degrade gracefully to org-level InputSelect when project-specific roles are unsupported.
  • +page.ts: listProjects is now called unconditionally (previously gated on the removed flag); errors are still swallowed with .catch(() => null).

Confidence Score: 5/5

The change is safe to merge — the flag removal and flag-field swap are straightforward, and the previously missing edit-button gate for org-roles-only plans is now corrected.

The logic is simple and well-scoped: the old feature flag is replaced by a plan field, the two role types are properly separated, and the one known gap (Edit button hidden for org-roles-only plans) has been addressed. No auth boundaries are changed and all error paths are handled.

No files require special attention.

Important Files Changed

Filename Overview
src/lib/flags.ts Removes the granularProjectAccess feature flag now that supportsProjectSpecificRoles on the plan object serves as the gate.
src/routes/(console)/organization-[organization]/createMember.svelte Replaces flag + supportsOrganizationRoles gate with supportsProjectSpecificRoles; removes unused flags and user imports.
src/routes/(console)/organization-[organization]/members/+page.svelte Adds separate supportsOrgRoles and supportsProjectRoles reactive vars; Edit role button now correctly shows for either flag, addressing the previous P1 gap.
src/routes/(console)/organization-[organization]/members/+page.ts listProjects is now called unconditionally (was previously gated behind the removed feature flag); graceful .catch(() => null) is retained.
src/routes/(console)/organization-[organization]/members/edit.svelte Uses supportsProjectSpecificRoles instead of the old flag + supportsOrganizationRoles; falls back cleanly to InputSelect org-role picker when project roles are unsupported.

Reviews (3): Last reviewed commit: "chore: remove unused granularProjectAcce..." | Re-trigger Greptile

Comment thread src/routes/(console)/organization-[organization]/members/+page.svelte Outdated
…ProjectSpecificRoles

supportsProjectSpecificRoles only controls the project-specific toggle inside
the edit modal. The Edit role button should show for any plan that supports
org-level roles — use a separate supportsOrgRoles derived from
supportsOrganizationRoles for that. Also add !! coercion for consistency.
Comment thread src/routes/(console)/organization-[organization]/members/+page.svelte Outdated
… roles

Gate solely on supportsProjectSpecificRoles plan flag — no feature flag
needed. Also always fetch orgProjects in page load since it is no longer
conditionally needed.
…ojectRoles is true

Plans with supportsProjectSpecificRoles=true but supportsOrganizationRoles=false
would show project-role badges in the table but have no way to edit them.
@HarshMN2345 HarshMN2345 merged commit ecdf051 into main Jun 4, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the feat-project-specific-roles-plan-flag branch June 4, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants