0
0
Fork 0
mirror of https://github.com/verdigado/organization_folders.git synced 2024-12-06 11:22:41 +01:00

Added inherit managers attribute to resources

This commit is contained in:
Jonathan Treffler 2024-11-06 17:32:33 +01:00
parent f7b3b2f255
commit fdb4b8fc76
8 changed files with 65 additions and 4 deletions

View file

@ -49,4 +49,23 @@ class ResourceMember extends Entity implements JsonSerializable, TableSerializab
'LastUpdated' => $this->lastUpdatedTimestamp,
];
}
public function getParsedPrincipal() {
if($this->type === MemberType::USER->value) {
return [
"userId" => $this->principal,
];
} else if($this->type === MemberType::GROUP->value) {
return [
"groupId" => $this->principal,
];
} else if($this->type === MemberType::ROLE->value) {
[$organizationProviderId, $roleId] = explode(":", $this->principal, 2);
return [
"organizationProviderId" => $organizationProviderId,
"roleId" => $roleId,
];
}
}
}