acl generics

This commit is contained in:
Yuri Kuznetsov
2022-03-12 19:59:55 +02:00
parent 0a5a82fb38
commit fca55da02f
30 changed files with 105 additions and 15 deletions
@@ -37,11 +37,13 @@ use Espo\Core\{
Acl\OwnershipOwnChecker,
};
/**
* @implements OwnershipOwnChecker<\Espo\Entities\Note>
*/
class OwnershipChecker implements OwnershipOwnChecker
{
public function checkOwn(User $user, Entity $entity): bool
{
if ($entity->get('type') === 'Post' && $user->getId() === $entity->get('createdById')) {
return true;
}