How to define custom permissions for staff, admins, moderators

There is also trust level 4 and category moderators, in discourse 2.5 and beyond.