Managing user permissions and security