Implement proper ACL checks and suid permission

Placeholder, not finished yet.
Why is this change necessary?