Skip to content

Commit f01c44d

Browse files
committed
Add org metadata to user project access via UserProjectAccess::getOrganizationInfo()
1 parent 24968cb commit f01c44d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Model/CentralizedPermissions/UserProjectAccess.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Platformsh\Client\Model\CentralizedPermissions;
44

55
use GuzzleHttp\ClientInterface;
6+
use Platformsh\Client\Model\Ref\OrganizationRef;
67
use Platformsh\Client\Model\Ref\ProjectRef;
78
use Platformsh\Client\Model\ResourceWithReferences;
89

@@ -38,4 +39,13 @@ public function getProjectInfo()
3839
}
3940
return null;
4041
}
42+
43+
/** @return OrganizationRef|null */
44+
public function getOrganizationInfo()
45+
{
46+
if (isset($this->data['ref:organizations'][$this->data['organization_id']])) {
47+
return $this->data['ref:organizations'][$this->data['organization_id']];
48+
}
49+
return null;
50+
}
4151
}

0 commit comments

Comments
 (0)