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

added user-has-manager-permissions dav prop; added principal model and simplified the ACL code with it

This commit is contained in:
Jonathan Treffler 2024-11-12 15:36:07 +01:00
parent 72fbc9e20e
commit 8bfa9dfa29
11 changed files with 172 additions and 114 deletions

29
lib/Model/Principal.php Normal file
View file

@ -0,0 +1,29 @@
<?php
namespace OCA\OrganizationFolders\Model;
use OCA\OrganizationFolders\Enum\PrincipalType;
class Principal implements \JsonSerializable {
public function __construct(
private PrincipalType $type,
private string $id,
) {
// check if id fits format
}
public function getType(): PrincipalType {
return $this->type;
}
public function getId(): string {
return $this->id;
}
public function jsonSerialize(): array {
return [
'type' => $this->type->value,
'id' => $this->id,
];
}
}