make(PermissionApplicator::class)->restrictEntityQuery($query); } /** * Get the entity jointPermissions this is connected to. */ public function jointPermissions(): HasMany { return $this->hasMany(JointPermission::class, 'entity_id')->whereColumn('entity_type', '=', 'entities.type'); } }