Implement user permission checking.