update permissions

This commit is contained in:
Hemachandar
2026-02-05 17:23:18 +05:30
parent bdda7d5594
commit 0d31205e4f
2 changed files with 20 additions and 2 deletions
+10 -1
View File
@@ -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")),
];
}
@@ -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")),
];
}
}