Implementing the core SQL based ACL layer.