Ammend the permission checks and to_ids

Signed-off-by: Malte Sussdorff <malte.sussdorff@cognovis.com>