This is a paper in the intersection of time series analysis and complexity theory that presents new results on permutation complexity in general and permutation entropy in particular. In this context, permutation complexity refers to the characterization of time series by means of ordinal patterns (permutations), entropic measures, decay rates of missing ordinal patterns, and more. Since the inception of this "ordinal" methodology, its practical application to any type of scalar time series and real-valued processes have proven to be simple and useful. However, the theoretical aspects have remained limited to noiseless deterministic series and dynamical systems, the main obstacle being the super-exponential growth of visible permutations with length when randomness (also in form of observational noise) is present in the data. To overcome this difficulty, we take a new approach through complexity classes, which are precisely defined by the growth of visible permutations with length, regardless of the deterministic or noisy nature of the data. We consider three major classes: exponential, sub-factorial and factorial. The next step is to adapt the concept of Z-entropy to each of those classes, which we call permutation entropy because it coincides with the conventional permutation entropy on the exponential class. Z-entropies are a family of group entropies, each of them extensive on a given complexity class. The result is a unified approach to the ordinal analysis of deterministic and random processes, from dynamical systems to white noise, with new concepts and tools. Numerical simulations show that permutation entropy discriminates time series from all complexity classes.