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")), ]; } }