Implement proper ACL checks and suid permission

Placeholder, not finished yet.
We need to know which chains come from api/1.0 requests and which are just user-created. Only api/1.0 ones need to be checked on suid secirity.