Cast limit to int for permission checking