From 0d31205e4fd25eea4d514cf0ecacbb20fbc3d7bf Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Thu, 5 Feb 2026 17:23:18 +0530 Subject: [PATCH] update permissions --- src/Appwrite/Platform/Modules/Compute/Base.php | 11 ++++++++++- .../Modules/Projects/Http/Projects/Action.php | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index db0cfe7daf..ee5f679330 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -32,11 +32,20 @@ class Base extends Action protected function getPermissions(string $teamId, string $projectId): array { return [ - Permission::read(Role::team(ID::custom($teamId))), + // Team-wide permissions + Permission::read(Role::team(ID::custom($teamId), 'owner')), + Permission::read(Role::team(ID::custom($teamId), 'developer')), Permission::update(Role::team(ID::custom($teamId), 'owner')), Permission::update(Role::team(ID::custom($teamId), 'developer')), Permission::delete(Role::team(ID::custom($teamId), 'owner')), Permission::delete(Role::team(ID::custom($teamId), 'developer')), + // Project-wide permissions + Permission::read(Role::team(ID::custom($teamId), "project-{$projectId}-owner")), + Permission::read(Role::team(ID::custom($teamId), "project-{$projectId}-developer")), + Permission::update(Role::team(ID::custom($teamId), "project-{$projectId}-owner")), + Permission::update(Role::team(ID::custom($teamId), "project-{$projectId}-developer")), + Permission::delete(Role::team(ID::custom($teamId), "project-{$projectId}-owner")), + Permission::delete(Role::team(ID::custom($teamId), "project-{$projectId}-developer")), ]; } diff --git a/src/Appwrite/Platform/Modules/Projects/Http/Projects/Action.php b/src/Appwrite/Platform/Modules/Projects/Http/Projects/Action.php index 1a3be1e783..21cd108485 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/Projects/Action.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/Projects/Action.php @@ -12,11 +12,20 @@ class Action extends AppwriteAction protected function getPermissions(string $teamId, string $projectId): array { return [ - Permission::read(Role::team(ID::custom($teamId))), + // Team-wide permissions + Permission::read(Role::team(ID::custom($teamId), 'owner')), + Permission::read(Role::team(ID::custom($teamId), 'developer')), Permission::update(Role::team(ID::custom($teamId), 'owner')), Permission::update(Role::team(ID::custom($teamId), 'developer')), Permission::delete(Role::team(ID::custom($teamId), 'owner')), Permission::delete(Role::team(ID::custom($teamId), 'developer')), + // Project-wide permissions + Permission::read(Role::team(ID::custom($teamId), "project-{$projectId}-owner")), + Permission::read(Role::team(ID::custom($teamId), "project-{$projectId}-developer")), + Permission::update(Role::team(ID::custom($teamId), "project-{$projectId}-owner")), + Permission::update(Role::team(ID::custom($teamId), "project-{$projectId}-developer")), + Permission::delete(Role::team(ID::custom($teamId), "project-{$projectId}-owner")), + Permission::delete(Role::team(ID::custom($teamId), "project-{$projectId}-developer")), ]; } }