We propose a novel algorithm for the capacitated passenger assignment problem in public transportation where exogenous priority lists define the order in which passengers are assigned. Separating explicitly theses rules from the assignment procedure allows for a great deal of flexibility to model various priority rules. When the actual rules are endogenous, the framework can easily be embedded in a fixed-point specification. Computational experiments are performed on a realistic case study based on the morning rush hours of the timetable of Canton Vaud, Switzerland. The algorithm is able to assign the demand in very low computational times. The results provide evidences that the ordering of the passengers does not have a significant impact on aggregate performance indicators (such as average delay and level of unsatisfied demand), but that the variability at the individual passenger level is substantial. Thanks to its flexibility, our framework can easily be implemented by a railway operator who wishes to evaluate the effects of different policies in terms of passenger priorities. (C) 2017 Elsevier Ltd. All rights reserved.