How to implement role-based access control for AI applications