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:
parent
f7b3b2f255
commit
fdb4b8fc76
8 changed files with 65 additions and 4 deletions
|
@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue