Implement proper ACL checks and suid permission

Placeholder, not finished yet.
I did not do any anonymous stuff tests yet, and there should be bugs there.